From: Li Huafei Date: Sat, 19 Oct 2024 15:41:55 +0000 (+0800) Subject: perf disasm: Use disasm_line__free() to properly free disasm_line X-Git-Tag: v6.13-rc1~68^2~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4e0e9a1e30059f4523c9b6a1f8045ad89b5db8a;p=thirdparty%2Flinux.git perf disasm: Use disasm_line__free() to properly free disasm_line The structure disasm_line contains members that require dynamically allocated memory and need to be freed correctly using disasm_line__free(). This patch fixes the incorrect release in symbol__disassemble_capstone(). Fixes: 6d17edc113de ("perf annotate: Use libcapstone to disassemble") Signed-off-by: Li Huafei Tested-by: Athira Rajeev Cc: sesse@google.com Cc: kjain@linux.ibm.com Link: https://lore.kernel.org/r/20241019154157.282038-1-lihuafei1@huawei.com Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index aef06a36bf40a..053b1f9ccc71e 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -1720,7 +1720,7 @@ err: */ list_for_each_entry_safe(dl, tmp, ¬es->src->source, al.node) { list_del(&dl->al.node); - free(dl); + disasm_line__free(dl); } } count = -1;