提交 53d03ba8 编写于 作者: W Wen Congyang

Fix memory leak in virDomainVcpuPinDel()

virDomainVcpuPinDefFree() does not free def->cputune.vcpupin if nvcpupin
is 0, and does not set def->cputune.vcpupin to NULL.

If we set nvcpupin to 0 but do not free vcpupin, vcpupin will not be freed
when vm->def is freed.

Use VIR_FREE() instead of virDomainVcpuPinDefFree() to free the memory
and set def->cputune.vcpupint to NULL.
上级 f1fea71d
......@@ -8263,7 +8263,7 @@ virDomainVcpuPinDel(virDomainDefPtr def, int vcpu)
return 0;
if (--def->cputune.nvcpupin == 0) {
virDomainVcpuPinDefFree(def->cputune.vcpupin, 0);
VIR_FREE(def->cputune.vcpupin);
} else {
if (VIR_REALLOC_N(def->cputune.vcpupin, def->cputune.nvcpupin) < 0) {
virReportOOMError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册