From 487adf70ef4df7f3bee309a541ccc6098bf5aa79 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Mon, 28 Sep 2020 06:44:41 +0000 Subject: [PATCH] cgroup: Resource leak (RESOURCE_LEAK) CID 302717 (#2 of 2): Resource leak (RESOURCE_LEAK) Variable dirnew going out of scope leaks the storage it points to. Signed-off-by: Adrian Reber --- criu/cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/cgroup.c b/criu/cgroup.c index 1f6d572573..ee4eba3328 100644 --- a/criu/cgroup.c +++ b/criu/cgroup.c @@ -1906,6 +1906,7 @@ static int rewrite_cgsets(CgroupEntry *cge, char **controllers, int n_controller cg->path + dirlen + 1); if (!cg->path) { cg->path = prev; + xfree(dirnew); return -ENOMEM; } xfree(prev);