Skip to content

Commit 874fa82

Browse files
captain5050namhyung
authored andcommitted
perf trace: Fix BTF memory leak
Add missing btf__free in trace__exit. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org> Link: https://lore.kernel.org/r/20250319050741.269828-14-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent ccc60dc commit 874fa82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tools/perf/builtin-trace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5339,6 +5339,10 @@ static void trace__exit(struct trace *trace)
53395339
zfree(&trace->syscalls.table);
53405340
}
53415341
zfree(&trace->perfconfig_events);
5342+
#ifdef HAVE_LIBBPF_SUPPORT
5343+
btf__free(trace->btf);
5344+
trace->btf = NULL;
5345+
#endif
53425346
}
53435347

53445348
#ifdef HAVE_BPF_SKEL

0 commit comments

Comments
 (0)