linux/tools/bpf/bpftool
Miaoqian Lin 12e6772017 bpftool: Fix memory leak in do_build_table_cb
[ Upstream commit fa55ef14ef ]

strdup() allocates memory for path. We need to release the memory in the
following error path. Add free() to avoid memory leak.

Fixes: 8f184732b6 ("bpftool: Switch to libbpf's hashmap for pinned paths of BPF objects")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221206071906.806384-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:23 +01:00
..
bash-completion
Documentation bpf: Define new BPF_MAP_TYPE_USER_RINGBUF map type 2022-09-21 16:24:17 -07:00
skeleton
.gitignore
btf_dumper.c bpftool: Fix a wrong type cast in btf_dumper_int 2022-08-25 11:43:08 -07:00
btf.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
cfg.c
cfg.h
cgroup.c bpftool: Fix wrong cgroup attach flags being assigned to effective progs 2022-09-21 10:57:12 -07:00
common.c bpftool: Fix memory leak in do_build_table_cb 2022-12-31 13:32:23 +01:00
feature.c bpftool: Fix a typo in a comment 2022-08-15 17:29:42 +02:00
gen.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
iter.c
jit_disasm.c tools bpftool: Fix compilation error with new binutils 2022-08-01 15:32:46 -03:00
json_writer.c
json_writer.h
link.c bpftool: Show parameters of BPF task iterators. 2022-09-28 16:30:08 -07:00
main.c bpftool: Clear errno after libcap's checks 2022-08-15 20:37:33 +02:00
main.h
Makefile bpftool: Complete libbfd feature detection 2022-08-10 10:44:01 -03:00
map_perf_ring.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
map.c bpf: Define new BPF_MAP_TYPE_USER_RINGBUF map type 2022-09-21 16:24:17 -07:00
net.c
netlink_dumper.c
netlink_dumper.h
perf.c
pids.c
prog.c bpftool: Replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE macro 2022-07-29 10:40:51 -07:00
struct_ops.c
tracelog.c
xlated_dumper.c
xlated_dumper.h