aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-09 20:34:49 +1030
committerAlan Modra <amodra@gmail.com>2019-12-10 09:07:29 +1030
commit20135676fc4c3912297c313b3e0d3cbd6cc402e3 (patch)
tree5073836e171a6fa7adbe05c60c23580e14defe79 /binutils
parent103ebbc35cc1975442e1e6233207d8d7b2016556 (diff)
downloadgdb-20135676fc4c3912297c313b3e0d3cbd6cc402e3.zip
gdb-20135676fc4c3912297c313b3e0d3cbd6cc402e3.tar.gz
gdb-20135676fc4c3912297c313b3e0d3cbd6cc402e3.tar.bz2
PR24960, Memory leak from disassembler
PR 24960 include/ * dis-asm.h (disassemble_free_target): Declare. opcodes/ * disassemble.c (disassemble_free_target): New function. binutils/ * objdump.c (disassemble_data): Call disassemble_free_target.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objdump.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b1ecef2..a194805 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
2019-12-10 Alan Modra <amodra@gmail.com>
+ PR 24960
+ * objdump.c (disassemble_data): Call disassemble_free_target.
+
+2019-12-10 Alan Modra <amodra@gmail.com>
+
* objdump.c (struct objdump_disasm_info): Delete "sec".
(find_symbol_for_address): Use inf->section rather than aux->sec.
(objdump_print_addr, disassemble_bytes): Likewise.
diff --git a/binutils/objdump.c b/binutils/objdump.c
index d48a73a..c10136e 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2730,6 +2730,7 @@ disassemble_data (bfd *abfd)
if (aux.dynrelbuf != NULL)
free (aux.dynrelbuf);
free (sorted_syms);
+ disassemble_free_target (&disasm_info);
}
static bfd_boolean