diff options
| author | 2026-08-09 00:14:42 -0700 | |
|---|---|---|
| committer | 2026-08-09 21:58:10 -0700 | |
| commit | 08e96e3c737bf63d917c6c4e0bb67450ad53f1d8 (patch) | |
| tree | 07efa309e5a410a2e548a75ef6967427e501d1fb /scripts/Makefile.thinlto | |
| parent | perf stat: Fix evsel_list leak in cmd_stat (diff) | |
perf tools: Fix sb_evlist leaks in top and record
Fix a memory leak in cmd_top() where top.sb_evlist was not freed if
evlist__add_bpf_sb_event() fails. Note that evlist__start_sb_thread() and
evlist__stop_sb_thread() take ownership of the evlist and free it, so
we must only free it if we fail before starting the thread. Also set
top.sb_evlist to NULL to prevent use-after-free bugs.
Apply the same fix to builtin-record.c to avoid leaking rec->sb_evlist
and calling pthread_join on uninitialized threads in the error path.
Assisted-by: Antigravity:gemini-3.1-pro
Fixes: b38d85ef49cf ("perf bpf: Decouple creating the evlist from adding the SB event")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
