summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>2018-12-17 16:57:50 +0900
committerDaniel Borkmann <daniel@iogearbox.net>2018-12-18 01:16:23 +0100
commit07a09d1b73c9651289d35449460d10e195e2f197 (patch)
tree201bc47820b7acbc125242e55fe09190abf2cf5b /tools/lib
parent37c7b1caeaf60c8d3bc3cedc9ff4b9cc2f015d7e (diff)
downloadtalos-obmc-linux-07a09d1b73c9651289d35449460d10e195e2f197.tar.gz
talos-obmc-linux-07a09d1b73c9651289d35449460d10e195e2f197.zip
bpf: libbpf: fix memleak by freeing line_info
This patch fixes a memory leak in libbpf by freeing up line_info member of struct bpf_program while unloading a program. Fixes: 3d65014146c6 ("bpf: libbpf: Add btf_line_info support to libbpf") Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/libbpf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index e2bc75ee1614..169e347c76f6 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -266,6 +266,7 @@ void bpf_program__unload(struct bpf_program *prog)
zclose(prog->btf_fd);
zfree(&prog->func_info);
+ zfree(&prog->line_info);
}
static void bpf_program__exit(struct bpf_program *prog)
OpenPOWER on IntegriCloud