From: Riccardo Mancini Date: Thu, 15 Jul 2021 16:07:12 +0000 (+0200) Subject: perf test maps__merge_in: Fix memory leak of maps X-Git-Tag: v5.15~689^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=244d1797c8c8e850b8de7992af713aa5c70d5650;p=platform%2Fkernel%2Flinux-starfive.git 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 Fixes: 79b6bb73f888933c ("perf maps: Merge 'struct maps' with 'struct map_groups'") Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/a1a29b97a58738987d150e94d4ebfad0282fb038.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/maps.c b/tools/perf/tests/maps.c index edcbc70..1ac7291 100644 --- a/tools/perf/tests/maps.c +++ b/tools/perf/tests/maps.c @@ -116,5 +116,7 @@ int test__maps__merge_in(struct test *t __maybe_unused, int subtest __maybe_unus ret = check_maps(merged3, ARRAY_SIZE(merged3), &maps); TEST_ASSERT_VAL("merge check failed", !ret); + + maps__exit(&maps); return TEST_OK; }