objdump: Free sorted_syms on error path

Message ID ZO6hdV2uhwv5Ywwb@squeak.grove.modra.org
State New
Headers
Series objdump: Free sorted_syms on error path |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 warning Patch is already merged

Commit Message

Alan Modra Aug. 30, 2023, 1:55 a.m. UTC
  * objdump.c (disassemble_data): Free sorted_syms before returning.
  

Patch

diff --git a/binutils/objdump.c b/binutils/objdump.c
index fb0db5d4fe8..60813426566 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -4151,6 +4151,7 @@  disassemble_data (bfd *abfd)
       non_fatal (_("can't disassemble for architecture %s\n"),
 		 bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
       exit_status = 1;
+      free (sorted_syms);
       return;
     }