From: Sohaib Mohamed <sohaib.amhmd@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: sohaib.amhmd@gmail.com, irogers@google.com, acme@kernel.org,
linux-perf-users@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: [PATCH] perf_counter tools: Fix memory leaks of add_cmdname()
Date: Fri, 19 Nov 2021 10:46:36 +0200 [thread overview]
Message-ID: <20211119084637.178890-1-sohaib.amhmd@gmail.com> (raw)
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
next reply other threads:[~2021-11-19 8:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 8:46 Sohaib Mohamed [this message]
2021-11-25 21:38 ` [PATCH] perf_counter tools: Fix memory leaks of add_cmdname() Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211119084637.178890-1-sohaib.amhmd@gmail.com \
--to=sohaib.amhmd@gmail.com \
--cc=acme@kernel.org \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).