Messages in this thread Patch in this message | | | From | Sohaib Mohamed <> | Subject | [PATCH] perf_counter tools: Fix memory leaks of add_cmdname() | Date | Fri, 19 Nov 2021 10:46:36 +0200 |
| |
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@gmail.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
| |