temp_ent is not free'ed in the error path if cgroup_process_v1_mnt() or
cgroup_process_v2_mnt() fails. Move the free'ing of temp_ent to error
path.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
}
}
- free(temp_ent);
-
if (!found_mnt) {
cg_mount_table[0].name[0] = '\0';
ret = ECGROUPNOTMOUNTED;
if (proc_mount)
fclose(proc_mount);
+ if (temp_ent)
+ free(temp_ent);
+
for (i = 0; controllers[i]; i++) {
free(controllers[i]);
controllers[i] = NULL;