]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: plug memory leak on error
authorEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 22:10:47 +0000 (16:10 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 22:14:31 +0000 (16:14 -0600)
Detected by Coverity.  Leak present since commit 874e65a; and
while commit d50bb45 tried to fix the issue, it missed a path.

* src/conf/domain_conf.c (virDomainDefParseBootXML): Always clean
up useserial.

src/conf/domain_conf.c

index 8cd493b3a6c97b623de4f2aae7de7d9b6316622d..844af27fee81cd6620f06ee3eb0af98571d697c4 100644 (file)
@@ -6327,13 +6327,13 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
         } else {
             def->os.bios.useserial = VIR_DOMAIN_BIOS_USESERIAL_NO;
         }
-        VIR_FREE(useserial);
     }
 
     *bootCount = deviceBoot;
     ret = 0;
 
 cleanup:
+    VIR_FREE(useserial);
     VIR_FREE(nodes);
     return ret;
 }