*/
goto cleanup;
}
+
cg_systemd_prune_init_scope(init_cgroup);
/* Check if the v2 hierarchy is mounted at its standard location.
while (getline(&line, &len, f) != -1) {
char *user_slice;
bool has_user_slice = false;
+
if (!is_cgv2(line))
continue;
free(user_slice);
cgv2_add_controller(NULL, mountpoint, current_cgroup, init_cgroup, has_user_slice);
+
/* Although the unified hierarchy can be mounted multiple times,
* each of those mountpoints will expose identical information.
* So let the first mountpoint we find, win.
fclose(f);
free(line);
- if (!ret)
+ if (!ret) {
+ free(init_cgroup);
free(current_cgroup);
+ }
return ret;
}