Skip to content

Commit 244d179

Browse files
Manciukicacmel
authored andcommitted
perf test maps__merge_in: Fix memory leak of maps
ASan reports a memory leak when running: # perf test "65: maps__merge_in" This is the second and final patch addressing these memory leaks. This time, the problem is simply that the maps object is never destructed. This patch adds the missing maps__exit call. Signed-off-by: Riccardo Mancini <[email protected]> Fixes: 79b6bb7 ("perf maps: Merge 'struct maps' with 'struct map_groups'") Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/a1a29b97a58738987d150e94d4ebfad0282fb038.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 581e295 commit 244d179

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/perf/tests/maps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,7 @@ int test__maps__merge_in(struct test *t __maybe_unused, int subtest __maybe_unus
116116

117117
ret = check_maps(merged3, ARRAY_SIZE(merged3), &maps);
118118
TEST_ASSERT_VAL("merge check failed", !ret);
119+
120+
maps__exit(&maps);
119121
return TEST_OK;
120122
}

0 commit comments

Comments
 (0)