[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] conf: fix memleak in qemuRestoreCgroupState



 131,088 bytes in 16 blocks are definitely lost in loss record 2,174 of 2,176
    at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x52A026F: virReallocN (viralloc.c:245)
    by 0x52BFCB5: saferead_lim (virfile.c:1268)
    by 0x52C00EF: virFileReadLimFD (virfile.c:1328)
    by 0x52C019A: virFileReadAll (virfile.c:1351)
    by 0x52A5D4F: virCgroupGetValueStr (vircgroup.c:763)
    by 0x1DDA0DA3: qemuRestoreCgroupState (qemu_cgroup.c:805)
    by 0x1DDA0DA3: qemuConnectCgroup (qemu_cgroup.c:857)
    by 0x1DDB7BA1: qemuProcessReconnect (qemu_process.c:3694)
    by 0x52FD171: virThreadHelper (virthread.c:206)
    by 0x82B8DF4: start_thread (pthread_create.c:308)
    by 0x85C31AC: clone (clone.S:113)

Signed-off-by: Luyao Huang <lhuang redhat com>
---
 src/qemu/qemu_cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 7d64ce7..f872525 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -796,6 +796,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
             virCgroupSetCpusetMems(cgroup_temp, nodeset) < 0)
             goto cleanup;
 
+        VIR_FREE(nodeset);
         virCgroupFree(&cgroup_temp);
     }
 
@@ -806,6 +807,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
             virCgroupSetCpusetMems(cgroup_temp, nodeset) < 0)
             goto cleanup;
 
+        VIR_FREE(nodeset);
         virCgroupFree(&cgroup_temp);
     }
 
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]