From: Daniel P. Berrange Date: Tue, 24 Sep 2013 15:11:39 +0000 (+0100) Subject: Fix leak in virDomainVcpuPinDefParseXML parsing cpumask X-Git-Tag: v1.1.3-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9bae3125015a304072390c483c3fa5463ca3723;p=thirdparty%2Flibvirt.git Fix leak in virDomainVcpuPinDefParseXML parsing cpumask If the virBitmapParse method fails due to OOM, we leak the 'tmp' variable string. Signed-off-by: Daniel P. Berrange --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 002b980b23..cee0c93d26 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10616,8 +10616,10 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node, int cpumasklen = VIR_DOMAIN_CPUMASK_LEN; if (virBitmapParse(set, 0, &def->cpumask, - cpumasklen) < 0) - goto error; + cpumasklen) < 0) { + VIR_FREE(tmp); + goto error; + } VIR_FREE(tmp); } else { virReportError(VIR_ERR_INTERNAL_ERROR,