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 <[email protected]> Reviewed-by: Namhyung Kim <[email protected]> Acked-by: Arnaldo Carvalho de Melo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent ccc60dc commit 874fa82

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)