linux-yocto/tools/bpf/bpftool
Yuan Chen 868b52651f bpftool: Fix JSON writer resource leak in version command
[ Upstream commit 85cd83fed8 ]

When using `bpftool --version -j/-p`, the JSON writer object
created in do_version() was not properly destroyed after use.
This caused a memory leak each time the version command was
executed with JSON output.

Fix: 004b45c0e5 (tools: bpftool: provide JSON output for all possible commands)

Suggested-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20250617132442.9998-1-chenyuan_fl@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:28:24 +02:00
..
bash-completion
Documentation
skeleton
.gitignore
btf_dumper.c
btf.c
cfg.c
cfg.h
cgroup.c
common.c bpftool: Fix readlink usage in get_fd_type 2025-06-04 14:42:14 +02:00
feature.c
gen.c
iter.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-06-12 11:11:38 +02:00
jit_disasm.c bpf, bpftool: Fix incorrect disasm pc 2024-12-09 10:32:07 +01:00
json_writer.c
json_writer.h
link.c
main.c bpftool: Fix JSON writer resource leak in version command 2025-08-28 16:28:24 +02:00
main.h bpftool: Mount bpffs on provided dir instead of parent dir 2024-06-12 11:11:38 +02:00
Makefile
map_perf_ring.c
map.c
net.c bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure 2025-08-15 12:08:45 +02:00
netlink_dumper.c
netlink_dumper.h
perf.c
pids.c
prog.c bpf: bpftool: Setting error code in do_loader() 2025-05-02 07:50:53 +02:00
struct_ops.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-06-12 11:11:38 +02:00
tracelog.c
xlated_dumper.c
xlated_dumper.h