提交 66f2db73 编写于 作者: D Daniel P. Berrange

Fix leak in virDomainDefParseXML parsing vcpupin

If virBitmapNew fails due to OOM, the 'vcpupin' variable
is leaked.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 d9bae312
......@@ -11194,8 +11194,10 @@ virDomainDefParseXML(xmlDocPtr xml,
if (VIR_ALLOC(vcpupin) < 0)
goto error;
if (!(vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN)))
if (!(vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN))) {
VIR_FREE(vcpupin);
goto error;
}
virBitmapCopy(vcpupin->cpumask, def->cpumask);
vcpupin->vcpuid = i;
def->cputune.vcpupin[def->cputune.nvcpupin++] = vcpupin;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册