diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2018-12-17 10:57:50 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-12-18 03:16:23 +0300 |
commit | 07a09d1b73c9651289d35449460d10e195e2f197 (patch) | |
tree | 201bc47820b7acbc125242e55fe09190abf2cf5b /tools | |
parent | 37c7b1caeaf60c8d3bc3cedc9ff4b9cc2f015d7e (diff) | |
download | linux-07a09d1b73c9651289d35449460d10e195e2f197.tar.xz |
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')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 1 |
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) |