summaryrefslogtreecommitdiff
path: root/obt/xml.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2014-10-28 05:20:10 +0100
committerMikael Magnusson <mikachu@gmail.com>2014-10-28 05:42:28 +0100
commit122e2a81d3899f918de81a735061776193ddeed8 (patch)
tree8c40c2fbcce57451ac16bd794dd82b7ec3fc140c /obt/xml.c
parent1491e196f3d05152fab127eb9cff3146a68a20a8 (diff)
Some fixes found by coverity for things used before a null check
In the second case, we actually check the wrong variable.
Diffstat (limited to 'obt/xml.c')
-rw-r--r--obt/xml.c2
1 files changed, 1 insertions, 1 deletions
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);