From: Mark Korenberg destroy_context() frees the disassembler context with LLVMDisposeMessage(), which is a plain free() meant for strings returned by LLVM. The context is therefore never destroyed, leaking about 28 KiB per disassembled function. Use LLVMDisasmDispose() instead. Fixes: eb9d1acf634b ("bpftool: Add LLVM as default library for disassembling JIT-ed programs") Signed-off-by: Mark Korenberg --- tools/bpf/bpftool/jit_disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c index 04541155e9cc..5ff144ce84a1 100644 --- a/tools/bpf/bpftool/jit_disasm.c +++ b/tools/bpf/bpftool/jit_disasm.c @@ -115,7 +115,7 @@ init_context(disasm_ctx_t *ctx, const char *arch, static void destroy_context(disasm_ctx_t *ctx) { - LLVMDisposeMessage(*ctx); + LLVMDisasmDispose(*ctx); } static int -- 2.56.0