Commit b76e8462 by Serge Hallyn Committed by Stéphane Graber

coverity: fix use-after-free in cgmanager.

parent 21a7c27f
...@@ -1243,8 +1243,10 @@ static bool collect_subsytems(void) ...@@ -1243,8 +1243,10 @@ static bool collect_subsytems(void)
} }
} }
fclose(f); fclose(f);
f = NULL;
free(line); free(line);
line = NULL;
collected: collected:
if (!nr_subsystems) { if (!nr_subsystems) {
...@@ -1257,8 +1259,10 @@ collected: ...@@ -1257,8 +1259,10 @@ collected:
if (!cgroup_use && errno != 0) if (!cgroup_use && errno != 0)
goto out_good; goto out_good;
if (cgroup_use) { if (cgroup_use) {
if (!verify_and_prune(cgroup_use)) if (!verify_and_prune(cgroup_use)) {
goto out_free; free_subsystems();
return false;
}
subsystems_inone[0] = NIH_MUST( strdup(cgroup_use) ); subsystems_inone[0] = NIH_MUST( strdup(cgroup_use) );
cgm_all_controllers_same = false; cgm_all_controllers_same = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment