From: Kamalesh Babulal Date: Thu, 4 Aug 2022 18:56:00 +0000 (-0600) Subject: tools/cgxget: de-allocate cg_convert_list[] in convert_cgroup() X-Git-Tag: v3.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ee1e9c77239f053822c67f60b4d102fbe9937af;p=thirdparty%2Flibcgroup.git 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 --- 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.