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

[libvirt] [PATCH] cgroup: Fix possible memory leak in virCgroupMakeGroup



* src/util/cgroup.c: free temporal path string before breaking loop
---
 src/util/cgroup.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index b649c3c..b8b2eb5 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -472,8 +472,10 @@ static int virCgroupMakeGroup(virCgroupPtr parent, virCgroupPtr group, int creat
                 (i == VIR_CGROUP_CONTROLLER_CPUSET ||
                  STREQ(group->controllers[i].mountPoint, group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
                 rc = virCgroupCpuSetInherit(parent, group);
-                if (rc != 0)
+                if (rc != 0) {
+                    VIR_FREE(path);
                     break;
+                }
             }
         }
 
-- 
1.6.5.2


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