macho-o.c don't leak strtab
authorAlan Modra <amodra@gmail.com>
Tue, 20 Jun 2023 23:51:54 +0000 (09:21 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Jun 2023 06:19:39 +0000 (15:49 +0930)
* mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on
success path.

bfd/mach-o.c

index 55407fa347d955c8d4bb24d00f8beff80d1adc01..4d414fd95dbe962ec3cfde7f6fb321642604e0e1 100644 (file)
@@ -2073,6 +2073,8 @@ bfd_mach_o_write_symtab_content (bfd *abfd, bfd_mach_o_symtab_command *sym)
   if (!_bfd_stringtab_emit (abfd, strtab))
     goto err;
 
+  _bfd_stringtab_free (strtab);
+
   /* Pad string table.  */
   padlen = bfd_mach_o_pad4 (abfd, sym->strsize);
   if (padlen < 0)