]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf script: Release zstd data
authorRiccardo Mancini <rickyman7@gmail.com>
Thu, 15 Jul 2021 16:07:17 +0000 (18:07 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Jul 2021 20:27:52 +0000 (17:27 -0300)
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: 899365f7d06681c6 ("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.1626343282.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-script.c

index 8c03a9862872d49575bba13c1dd531856240d768..bae0e5b72c0e6050fb829a9adb99b6be5f171fad 100644 (file)
@@ -4143,6 +4143,7 @@ out_delete:
                zfree(&script.ptime_range);
        }
 
+       zstd_fini(&(session->zstd_data));
        evlist__free_stats(session->evlist);
        perf_session__delete(session);