perf bpf: Fix memory leaks relating to BTF.

BTF needs to be freed with btf__free().

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20210826184833.408563-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Ian Rogers
2021-08-26 11:48:33 -07:00
committed by Arnaldo Carvalho de Melo
parent 760f5e77e6
commit 298105b78b
2 changed files with 3 additions and 3 deletions

View File

@@ -1833,7 +1833,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
ret = 0;
out:
free(prog_linfo);
free(btf);
btf__free(btf);
fclose(s);
bfd_close(bfdf);
return ret;