tools, bpftool: Fix memory leak in codegen error cases
authorTobias Klauser <tklauser@distanz.ch>
Wed, 10 Jun 2020 13:08:04 +0000 (15:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:49:10 +0000 (17:49 +0200)
commit2c207411b808256f92b24e5d61b0f31089b268ed
tree86ca4c253d537cfe381ca6b7426121b6c3a93edf
parent8e337f731d86f422101f16f234cb961be9ed06d8
tools, bpftool: Fix memory leak in codegen error cases

[ Upstream commit d4060ac969563113101c79433f2ae005feca1c29 ]

Free the memory allocated for the template on error paths in function
codegen.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200610130804.21423-1-tklauser@distanz.ch
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/gen.c