Commit 868b5265 authored by Yuan Chen's avatar Yuan Chen Committed by Greg Kroah-Hartman
Browse files

bpftool: Fix JSON writer resource leak in version command



[ Upstream commit 85cd83fe ]

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: 004b45c0 (tools: bpftool: provide JSON output for all possible commands)

Suggested-by: default avatarQuentin Monnet <qmo@kernel.org>
Signed-off-by: default avatarYuan Chen <chenyuan@kylinos.cn>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Reviewed-by: default avatarQuentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20250617132442.9998-1-chenyuan_fl@163.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d930e738
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment