Commit 659ede7d authored by Riccardo Mancini's avatar Riccardo Mancini Committed by Arnaldo Carvalho de Melo

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: default avatarRiccardo Mancini <rickyman7@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/34d08535b11124106b859790549991abff5a7de8.1626343282.git.rickyman7@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3cb4d5e0
......@@ -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 = ',';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment