Some fixes found by coverity for things used before a null check
[dana/openbox.git] / obt / xml.c
index 223ad02..f200ae7 100644 (file)
--- 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);