From 122e2a81d3899f918de81a735061776193ddeed8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 28 Oct 2014 05:20:10 +0100 Subject: Some fixes found by coverity for things used before a null check In the second case, we actually check the wrong variable. --- obt/xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'obt/xml.c') diff --git a/obt/xml.c b/obt/xml.c index 223ad02b..f200ae75 100644 --- a/obt/xml.c +++ b/obt/xml.c @@ -281,7 +281,7 @@ gboolean obt_xml_load_mem(ObtXmlInst *i, xmlResetLastError(); i->doc = xmlParseMemory(data, len); - if (i) { + if (i->doc) { i->root = xmlDocGetRootElement(i->doc); if (!i->root) { xmlFreeDoc(i->doc); -- cgit v1.2.3