linux-stable/tools/lib
Hao Luo 29d67fdebc libbpf: Free btf_vmlinux when closing bpf_object
I hit a memory leak when testing bpf_program__set_attach_target().
Basically, set_attach_target() may allocate btf_vmlinux, for example,
when setting attach target for bpf_iter programs. But btf_vmlinux
is freed only in bpf_object_load(), which means if we only open
bpf object but not load it, setting attach target may leak
btf_vmlinux.

So let's free btf_vmlinux in bpf_object__close() anyway.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230822193840.1509809-1-haoluo@google.com
2023-08-22 16:16:31 -07:00
..
api tools api: Add simple timeout to io read 2023-06-14 18:19:06 -03:00
bpf libbpf: Free btf_vmlinux when closing bpf_object 2023-08-22 16:16:31 -07:00
perf perf evlist: Propagate user CPU maps intersecting core PMU maps 2023-05-27 09:38:39 -03:00
subcmd libsubcmd: Avoid SEGV/use-after-free when commands aren't excluded 2023-07-11 16:44:12 -03:00
symbol tools lib symbol: Add dependency test to install_headers 2022-12-14 11:16:12 -03:00
thermal tools/lib/thermal: Fix include path for libnl3 in pkg-config file. 2023-02-15 17:29:40 +01:00
argv_split.c
bitmap.c
ctype.c
find_bit.c
hweight.c
list_sort.c
rbtree.c
slab.c
str_error_r.c
string.c
vsprintf.c
zalloc.c