Skip to content

Commit

Permalink
cgroup: Resource leak (RESOURCE_LEAK)
Browse files Browse the repository at this point in the history
CID 302714 (#1 of 1): Resource leak (RESOURCE_LEAK)
 Variable dirnew going out of scope leaks the storage it points to.

Signed-off-by: Adrian Reber <areber@redhat.com>
  • Loading branch information
adrianreber authored and avagin committed Oct 20, 2020
1 parent af569ac commit da5a4d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions criu/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ static int rewrite_cgsets(CgroupEntry *cge, char **controllers, int n_controller
cg->path = xsprintf("%s%s", newroot, cg->path + cg->cgns_prefix);
if (!cg->path) {
cg->path = prev;
xfree(dirnew);
return -ENOMEM;
}
xfree(prev);
Expand Down

0 comments on commit da5a4d6

Please sign in to comment.