objdump: Free sorted_syms on error path
authorAlan Modra <amodra@gmail.com>
Wed, 30 Aug 2023 01:48:01 +0000 (11:18 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 30 Aug 2023 01:52:23 +0000 (11:22 +0930)
* objdump.c (disassemble_data): Free sorted_syms before returning.

binutils/objdump.c

index fb0db5d4fe835a552302632407ae1436176ec12c..608134265669d724cca54c605c553abc9fc58944 100644 (file)
@@ -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;
     }