mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 18:05:20 +00:00
qemu: fix resource leak
Error: RESOURCE_LEAK: /libvirt/src/qemu/qemu_driver.c:6968: alloc_fn: Calling allocation function "calloc". /libvirt/src/qemu/qemu_driver.c:6968: var_assign: Assigning: "nodeset" = storage returned from "calloc(1UL, 1UL)". /libvirt/src/qemu/qemu_driver.c:6977: noescape: Variable "nodeset" is not freed or pointed-to in function "virTypedParameterAssign". /libvirt/src/qemu/qemu_driver.c:6997: leaked_storage: Variable "nodeset" going out of scope leaks the storage it points to.
This commit is contained in:
parent
409a637eb1
commit
c0774482ff
@ -6991,6 +6991,9 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
|
|||||||
if (virTypedParameterAssign(param, VIR_DOMAIN_NUMA_NODESET,
|
if (virTypedParameterAssign(param, VIR_DOMAIN_NUMA_NODESET,
|
||||||
VIR_TYPED_PARAM_STRING, nodeset) < 0)
|
VIR_TYPED_PARAM_STRING, nodeset) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
nodeset = NULL;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -7004,6 +7007,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
VIR_FREE(nodeset);
|
||||||
virCgroupFree(&group);
|
virCgroupFree(&group);
|
||||||
if (vm)
|
if (vm)
|
||||||
virDomainObjUnlock(vm);
|
virDomainObjUnlock(vm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user