cgroup: Fix possible memory leak in virCgroupMakeGroup

* src/util/cgroup.c: free temporal path string before breaking loop
This commit is contained in:
Ryota Ozaki 2010-05-04 04:04:51 +09:00 committed by Eric Blake
parent b9c4db0d70
commit c4157e5272

View File

@ -472,10 +472,12 @@ 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;
}
}
}
VIR_FREE(path);
}