mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
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.
This commit is contained in:
parent
f1fea71df5
commit
53d03ba837
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user