From 20135676fc4c3912297c313b3e0d3cbd6cc402e3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 9 Dec 2019 20:34:49 +1030 Subject: 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. --- include/ChangeLog | 5 +++++ include/dis-asm.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 7c4fcb8..681cbfa 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,10 @@ 2019-12-10 Alan Modra + PR 24960 + * dis-asm.h (disassemble_free_target): Declare. + +2019-12-10 Alan Modra + * dis-asm.h (struct disassemble_info): Delete insn_sets. (INIT_DISASSEMBLE_INFO_NO_ARCH): Don't define. diff --git a/include/dis-asm.h b/include/dis-asm.h index c1746502..82bf4dc 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -325,7 +325,10 @@ extern disassembler_ftype disassembler (enum bfd_architecture arc, /* Amend the disassemble_info structure as necessary for the target architecture. Should only be called after initialising the info->arch field. */ -extern void disassemble_init_for_target (struct disassemble_info * dinfo); +extern void disassemble_init_for_target (struct disassemble_info *); + +/* Tidy any memory allocated by targets, such as info->private_data. */ +extern void disassemble_free_target (struct disassemble_info *); /* Document any target specific options available from the disassembler. */ extern void disassembler_usage (FILE *); -- cgit v1.1