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

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

 



* 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]