From 9a925d0dad55a3cd4e493642b81c668d2ab09d1d Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 21 Jun 2023 09:21:54 +0930 Subject: [PATCH] macho-o.c don't leak strtab * mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on success path. --- bfd/mach-o.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 55407fa347d..4d414fd95db 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) -- 2.30.2