public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] macho-o.c don't leak strtab
Date: Wed, 21 Jun 2023 06:19:56 +0000 (GMT)	[thread overview]
Message-ID: <20230621061956.1B0C63858D1E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9a925d0dad55a3cd4e493642b81c668d2ab09d1d

commit 9a925d0dad55a3cd4e493642b81c668d2ab09d1d
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jun 21 09:21:54 2023 +0930

    macho-o.c don't leak strtab
    
            * 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;
 
+  _bfd_stringtab_free (strtab);
+
   /* Pad string table.  */
   padlen = bfd_mach_o_pad4 (abfd, sym->strsize);
   if (padlen < 0)

                 reply	other threads:[~2023-06-21  6:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621061956.1B0C63858D1E@sourceware.org \
    --to=amodra@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).