Skip to content

Commit da6b7c6

Browse files
Manciukicacmel
authored andcommitted
perf env: Fix memory leak of cpu_pmu_caps
ASan reports memory leaks while running: # perf test "83: Zstd perf.data compression/decompression" The first of the leaks is caused by env->cpu_pmu_caps not being freed. This patch adds the missing (z)free inside perf_env__exit. Signed-off-by: Riccardo Mancini <[email protected]> Fixes: 6f91ea2 ("perf header: Support CPU PMU capabilities") Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/6ba036a8220156ec1f3d6be3e5d25920f6145028.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 244d179 commit da6b7c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/perf/util/env.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ void perf_env__exit(struct perf_env *env)
191191
zfree(&env->sibling_threads);
192192
zfree(&env->pmu_mappings);
193193
zfree(&env->cpu);
194+
zfree(&env->cpu_pmu_caps);
194195
zfree(&env->numa_map);
195196

196197
for (i = 0; i < env->nr_numa_nodes; i++)

0 commit comments

Comments
 (0)