1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

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 <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-09-24 16:11:39 +01:00
parent 1fff45cca9
commit d9bae31250

View File

@ -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,