[PATCH v2 11/26] perf stat: Avoid evlist leak
Ian Rogers
irogers at google.com
Thu Jun 8 16:28:08 PDT 2023
Free evlist before overwriting in "perf stat report" mode. Detected
using leak sanitizer.
Signed-off-by: Ian Rogers <irogers at google.com>
---
tools/perf/builtin-stat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c87c6897edc9..fc615bdeed4f 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -2427,6 +2427,7 @@ static int __cmd_report(int argc, const char **argv)
perf_stat.session = session;
stat_config.output = stderr;
+ evlist__delete(evsel_list);
evsel_list = session->evlist;
ret = perf_session__process_events(session);
--
2.41.0.162.gfafddb0af9-goog
More information about the linux-arm-kernel
mailing list