From: Eric Blake Date: Thu, 13 Oct 2011 22:10:47 +0000 (-0600) Subject: conf: plug memory leak on error X-Git-Tag: v0.9.7-rc1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fa3d775a9f8cdb3423373eb084219aaf778df11;p=thirdparty%2Flibvirt.git conf: plug memory leak on error 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. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8cd493b3a6..844af27fee 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; }