From: Riccardo Mancini rickyman7@gmail.com
[ Upstream commit 1b1f57cf9e4c8eb16c8f6b2ce12cc5dd3517fc61 ]
ASan reports several memory leak while running:
# perf test "82: Use vfs_getname probe to get syscall args filenames"
One of the leaks is caused by zstd data not being released on exit in perf-script.
This patch adds the missing zstd_fini().
Signed-off-by: Riccardo Mancini rickyman7@gmail.com Fixes: b13b04d9382113f7 ("perf script: Initialize zstd_data") Cc: Ian Rogers irogers@google.com Cc: Jiri Olsa jolsa@redhat.com Cc: Mark Rutland mark.rutland@arm.com Cc: Milian Wolff milian.wolff@kdab.com Cc: Namhyung Kim namhyung@kernel.org Cc: Peter Zijlstra peterz@infradead.org Link: http://lore.kernel.org/lkml/39388e8cc2f85ca219ea18697a17b7bd8f74b693.1626343... Signed-off-by: Arnaldo Carvalho de Melo acme@redhat.com Signed-off-by: Sasha Levin sashal@kernel.org --- tools/perf/builtin-script.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 1280cbfad4db..8a6656ab835b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3991,6 +3991,7 @@ out_delete: zfree(&script.ptime_range); }
+ zstd_fini(&(session->zstd_data)); evlist__free_stats(session->evlist); perf_session__delete(session);