Re: [PATCH] bpftool: Fix JSON writer resource leak in version command
From: Quentin Monnet
Date: Mon Jun 16 2025 - 11:50:17 EST
2025-06-16 11:27 UTC-0400 ~ Yuan Chen <chenyuan_fl@xxxxxxx>
> From: Yuan Chen <chenyuan@xxxxxxxxxx>
>
> 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: 004b45c0e51a (tools: bpftool: provide JSON output for all possible commands)
> Signed-off-by: Yuan Chen <chenyuan@xxxxxxxxxx>
> Suggested-by: Quentin Monnet <qmo@xxxxxxxxxx>
Thanks a lot! Please, for future patches, state the version of your
patch (if > 1) in the prefix of your email subject:
[PATCH bpf-next v2] bpftool: Fix JSON writer...
Reviewed-by: Quentin Monnet <qmo@xxxxxxxxxx>