lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf_counter tools: Fix memory leaks of add_cmdname()
Date
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
\
 
 \ /
  Last update: 2021-11-19 09:47    [W:0.535 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site