Skip to content

Commit 659ede7

Browse files
Manciukicacmel
authored andcommitted
perf trace: Free strings in trace__parse_events_option()
ASan reports several memory leaks running: # 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 <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/34d08535b11124106b859790549991abff5a7de8.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 3cb4d5e commit 659ede7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/perf/builtin-trace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4659,6 +4659,9 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
46594659
err = parse_events_option(&o, lists[0], 0);
46604660
}
46614661
out:
4662+
free(strace_groups_dir);
4663+
free(lists[0]);
4664+
free(lists[1]);
46624665
if (sep)
46634666
*sep = ',';
46644667

0 commit comments

Comments
 (0)