]> xenbits.xensource.com Git - libvirt.git/commitdiff
avoid a double-free bug
authorJim Meyering <meyering@redhat.com>
Fri, 16 May 2008 09:30:10 +0000 (09:30 +0000)
committerJim Meyering <meyering@redhat.com>
Fri, 16 May 2008 09:30:10 +0000 (09:30 +0000)
* src/qemu_conf.c (qemudParseXML): Ensure that "obj" is either
NULL or a valid malloc'd pointer before we might "goto error"
where it is freed.

ChangeLog
src/qemu_conf.c

index 7a455b9f10e1c7617e5eee98ed236efa490c96e0..1d524f4682fde46b0061883469df0fc08dbb0339 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri May 16 11:29:30 CEST 2008 Jim Meyering <meyering@redhat.com>
+
+       avoid a double-free bug
+       * src/qemu_conf.c (qemudParseXML): Ensure that "obj" is either
+       NULL or a valid malloc'd pointer before we might "goto error"
+       where it is freed.
+
 Thu May 15 16:06:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        * src/qemu_conf.c: Remove use of strcmp()
index 458f5dfe23a47c0c694d0bc8e4b903b4b822a683..1a7ab463506ad844b2fd26459e7f0219354449d0 100644 (file)
@@ -1736,6 +1736,7 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
     } else {
         strcpy(def->os.type, (const char *)obj->stringval);
         xmlXPathFreeObject(obj);
+        obj = NULL;
     }
 
     if (!virCapabilitiesSupportsGuestOSType(driver->caps, def->os.type)) {