[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211119084637.178890-1-sohaib.amhmd@gmail.com>
Date: Fri, 19 Nov 2021 10:46:36 +0200
From: Sohaib Mohamed <sohaib.amhmd@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: sohaib.amhmd@...il.com, irogers@...gle.com, acme@...nel.org,
linux-perf-users@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org
Subject: [PATCH] perf_counter tools: Fix memory leaks of add_cmdname()
ASan reports some memory leaks when running:
$ perf xyz
This patch adds the missing clean_cmdnames()
Fixes: 078006012401 ("perf_counter tools: add in basic glue from Git")
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@...il.com>
---
tools/lib/subcmd/help.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
index bf02d62a3b2b..4a433f4d19a1 100644
--- a/tools/lib/subcmd/help.c
+++ b/tools/lib/subcmd/help.c
@@ -187,6 +187,7 @@ static void list_commands_in_dir(struct cmdnames *cmds,
add_cmdname(cmds, de->d_name + prefix_len, entlen);
}
+ clean_cmdnames(cmds);
closedir(dir);
free(buf);
}
--
2.25.1
Powered by blists - more mailing lists