mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
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: 6d17edc113
("perf annotate: Use libcapstone to disassemble")
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Tested-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
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 <namhyung@kernel.org>
This commit is contained in:
parent
36fae9f93e
commit
b4e0e9a1e3
@ -1720,7 +1720,7 @@ static int symbol__disassemble_capstone(char *filename, struct symbol *sym,
|
||||
*/
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user