lkml.org 
[lkml]   [2021]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18/20] perf trace: free strings in trace__parse_events_option
Date
ASan reports several memory leaks running the perf test
"88: Check open filename arg using perf trace + vfs_getname".
The fourth of these leaks is related to some strings never being freed
in trace__parse_events_option.

This patch adds the missing frees.

Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
---
tools/perf/builtin-trace.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d9c65d55a9ae7526..4a677f3ff273887a 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -4659,6 +4659,9 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
err = parse_events_option(&o, lists[0], 0);
}
out:
+ free(strace_groups_dir);
+ free(lists[0]);
+ free(lists[1]);
if (sep)
*sep = ',';

--
2.31.1
\
 
 \ /
  Last update: 2021-07-15 18:09    [W:0.440 / U:21.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site