]> xenbits.xensource.com Git - libvirt.git/commitdiff
cgroup: Fix possible memory leak in virCgroupMakeGroup
authorRyota Ozaki <ozaki.ryota@gmail.com>
Mon, 3 May 2010 19:04:51 +0000 (04:04 +0900)
committerEric Blake <eblake@redhat.com>
Mon, 3 May 2010 21:01:12 +0000 (15:01 -0600)
* src/util/cgroup.c: free temporal path string before breaking loop

src/util/cgroup.c

index b649c3c1da47b81a9a15990bcde2d0085370e8c4..b8b2eb51c45d645ef02ec898c9a61a793436808e 100644 (file)
@@ -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;
+                }
             }
         }