Skip to content

Commit 07a09d1

Browse files
pbholeborkmann
authored andcommitted
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: 3d65014 ("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>
1 parent 37c7b1c commit 07a09d1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ void bpf_program__unload(struct bpf_program *prog)
266266

267267
zclose(prog->btf_fd);
268268
zfree(&prog->func_info);
269+
zfree(&prog->line_info);
269270
}
270271

271272
static void bpf_program__exit(struct bpf_program *prog)

0 commit comments

Comments
 (0)