]> xenbits.xensource.com Git - libvirt.git/commitdiff
xen: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Mon, 4 May 2015 16:00:40 +0000 (12:00 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 May 2015 00:02:37 +0000 (20:02 -0400)
Coverity found that xenXMConfigCacheAddFile has an error path in which
no error message and a -1 was not returned which could have resulted in
a NULL dereference in a VIR_DEBUG statement and of course an erroneous
0 value returned!

src/xen/xm_internal.c

index 64752dfa6393e6030d765b48653bb3f7c7e52221..59b1cd4afac2b54f9df4f1cd6eb074de7adfe3ba 100644 (file)
@@ -279,6 +279,9 @@ xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename)
             virDomainDefFree(entry->def);
             VIR_FREE(entry->filename);
             VIR_FREE(entry);
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("xenXMConfigCacheRefresh: virHashAddEntry name"));
+            return -1;
         }
     }
     VIR_DEBUG("Added config %s %s", entry->def->name, filename);