From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 1B0C63858D1E; Wed, 21 Jun 2023 06:19:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B0C63858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] macho-o.c don't leak strtab X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: 69141f080c01cca223ab061b85feacf17eeaf965 X-Git-Newrev: 9a925d0dad55a3cd4e493642b81c668d2ab09d1d Message-Id: <20230621061956.1B0C63858D1E@sourceware.org> Date: Wed, 21 Jun 2023 06:19:56 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2023 06:19:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9a925d0dad55= a3cd4e493642b81c668d2ab09d1d commit 9a925d0dad55a3cd4e493642b81c668d2ab09d1d Author: Alan Modra Date: Wed Jun 21 09:21:54 2023 +0930 macho-o.c don't leak strtab =20 * mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on success path. Diff: --- 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; =20 + _bfd_stringtab_free (strtab); + /* Pad string table. */ padlen =3D bfd_mach_o_pad4 (abfd, sym->strsize); if (padlen < 0)