From 6ee1e9c77239f053822c67f60b4d102fbe9937af Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Thu, 4 Aug 2022 12:56:00 -0600 Subject: [PATCH] tools/cgxget: de-allocate cg_convert_list[] in convert_cgroup() The commit 66799b867c7 (tools/cgxget: fix the resource leak in convert_cgroup()), is a partial fix. It de-allocated the array members of the dynamically allocated cg_converted_list[], but fails to free() the cg_converted_list. Fix the resource leak by de-allocating it. Fixes: 66799b867c7 (tools/cgxget: fix the resource leak in convert_group) Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- src/tools/cgxget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/cgxget.c b/src/tools/cgxget.c index 96fe79b4..0d7da5b8 100644 --- a/src/tools/cgxget.c +++ b/src/tools/cgxget.c @@ -770,6 +770,7 @@ out: /* The conversion failed */ for (j = 0; j < i; j++) cgroup_free(&(cg_converted_list[j])); + free(cg_converted_list); } else { /* * The conversion succeeded or was unmappable. -- 2.47.2