OSDN Git Service

selftests/bpf: Fix memory leaks in btf_type_c_dump() helper
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:15 +0000 (08:55 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Nov 2021 17:14:15 +0000 (09:14 -0800)
commit8ba285874913da21ca39a46376e9cc5ce0f45f94
tree25e14aa1dc17f8dc4dd4ad51da01be35bc70fe0a
parent8f7b239ea8cfdc8e64c875ee417fed41431a1f37
selftests/bpf: Fix memory leaks in btf_type_c_dump() helper

Free up memory and resources used by temporary allocated memstream and
btf_dump instance.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-4-andrii@kernel.org
tools/testing/selftests/bpf/btf_helpers.c