aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-06-21 09:21:54 +0930
committerAlan Modra <amodra@gmail.com>2023-06-21 15:49:39 +0930
commit9a925d0dad55a3cd4e493642b81c668d2ab09d1d (patch)
tree274b29fda31ef4af319e20fac83faaeed9febace /bfd
parent69141f080c01cca223ab061b85feacf17eeaf965 (diff)
downloadfsf-binutils-gdb-9a925d0dad55a3cd4e493642b81c668d2ab09d1d.zip
fsf-binutils-gdb-9a925d0dad55a3cd4e493642b81c668d2ab09d1d.tar.gz
fsf-binutils-gdb-9a925d0dad55a3cd4e493642b81c668d2ab09d1d.tar.bz2
macho-o.c don't leak strtab
* mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on success path.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/mach-o.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 55407fa..4d414fd 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -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)