Skip to content
Commit ebbd7f64 authored by Quentin Monnet's avatar Quentin Monnet Committed by Andrii Nakryiko
Browse files

bpftool: Fix memory leak in prog_dump()



Following the extraction of prog_dump() from do_dump(), the struct btf
allocated in prog_dump() is no longer freed on error; the struct
bpf_prog_linfo is not freed at all. Make sure we release them before
exiting the function.

Fixes: ec202509 ("bpftool: Match several programs with same tag")
Signed-off-by: default avatarQuentin Monnet <quentin@isovalent.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211110114632.24537-2-quentin@isovalent.com
parent 325d956d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment