Skip to content

Commit

Permalink
perf test session_topology: Delete session->evlist
Browse files Browse the repository at this point in the history
ASan reports a memory leak related to session->evlist while running:

  # perf test "41: Session topology".

When perf_data is in write mode, session->evlist is owned by the caller,
which should also take care of deleting it.

This patch adds the missing evlist__delete().

Signed-off-by: Riccardo Mancini <[email protected]>
Fixes: c84974e ("perf test: Add entry to test cpu topology")
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/822f741f06eb25250fb60686cf30a35f447e9e91.1626343282.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Manciukic authored and acmel committed Jul 15, 2021
1 parent 42db3d9 commit 233f2dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/tests/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static int session_write_header(char *path)
TEST_ASSERT_VAL("failed to write header",
!perf_session__write_header(session, session->evlist, data.file.fd, true));

evlist__delete(session->evlist);
perf_session__delete(session);

return 0;
Expand Down

0 comments on commit 233f2dc

Please sign in to comment.