]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf data convert json: Fix addr_location leak on time-filtered samples
authorTanushree Shah <tshah@linux.ibm.com>
Sat, 6 Jun 2026 12:15:29 +0000 (17:45 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 10 Jun 2026 20:05:48 +0000 (17:05 -0300)
commit2857a5dca750ea989c6fb70b4c14e801e4b7b4ad
tree7c97bc46584f402e7ee1d3ce958f9b9198c20cd5
parent49f5f6ae67dec54014584bb3126a5a94f14e2a5c
perf data convert json: Fix addr_location leak on time-filtered samples

When samples are skipped due to time filtering in process_sample_event(),
the early return path bypasses addr_location__exit(), causing memory leaks
of thread, map, and maps references acquired by machine__resolve().

These references must be released through addr_location__exit() before
returning.

Fixes: 8e746e95c3e4eb56 ("perf data: Allow filtering conversion by time range")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Tanushree Shah <tshah@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Athira Rajeev <atrajeev@linux.ibm.com>
Cc: Derek Foreman <derek.foreman@collabora.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Shivani.Nittor@ibm.com
Cc: Tanushree.Shah@ibm.com
Cc: Tejas.Manhas1@ibm.com
Cc: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data-convert-json.c