mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cgroup: Fix possible memory leak in virCgroupMakeGroup
* src/util/cgroup.c: free temporal path string before breaking loop
This commit is contained in:
@@ -472,10 +472,12 @@ static int virCgroupMakeGroup(virCgroupPtr parent, virCgroupPtr group, int creat
|
|||||||
(i == VIR_CGROUP_CONTROLLER_CPUSET ||
|
(i == VIR_CGROUP_CONTROLLER_CPUSET ||
|
||||||
STREQ(group->controllers[i].mountPoint, group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
|
STREQ(group->controllers[i].mountPoint, group->controllers[VIR_CGROUP_CONTROLLER_CPUSET].mountPoint))) {
|
||||||
rc = virCgroupCpuSetInherit(parent, group);
|
rc = virCgroupCpuSetInherit(parent, group);
|
||||||
if (rc != 0)
|
if (rc != 0) {
|
||||||
|
VIR_FREE(path);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user