From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] bfd/elf.c strtab memory leak
Date: Wed, 7 Jun 2023 02:02:19 +0000 (GMT) [thread overview]
Message-ID: <20230607020219.77A1D3857B98@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c7e6669a5b29240b1e5f6fd2acc987fd75b71044
commit c7e6669a5b29240b1e5f6fd2acc987fd75b71044
Author: Alan Modra <amodra@gmail.com>
Date: Wed Jun 7 09:41:57 2023 +0930
bfd/elf.c strtab memory leak
* elf.c (_bfd_elf_compute_section_file_positions): Free strtab
on set_group_contents failure return path.
Diff:
---
bfd/elf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bfd/elf.c b/bfd/elf.c
index 81eb3ef71fa..af2fb04dcbe 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4254,7 +4254,11 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
{
bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed);
if (failed)
- return false;
+ {
+ if (need_symtab)
+ _bfd_elf_strtab_free (strtab);
+ return false;
+ }
}
shstrtab_hdr = &elf_tdata (abfd)->shstrtab_hdr;
reply other threads:[~2023-06-07 2:02 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=20230607020219.77A1D3857B98@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).