diff options
author | Alan Modra <amodra@gmail.com> | 2023-06-07 09:41:57 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-06-07 11:05:11 +0930 |
commit | c7e6669a5b29240b1e5f6fd2acc987fd75b71044 (patch) | |
tree | a008170f4b38de4db42fd74787c5937ec4065180 /bfd/elf.c | |
parent | f5c0d77088ee2878813861b5b72fa64001f1831a (diff) | |
download | gdb-c7e6669a5b29240b1e5f6fd2acc987fd75b71044.zip gdb-c7e6669a5b29240b1e5f6fd2acc987fd75b71044.tar.gz gdb-c7e6669a5b29240b1e5f6fd2acc987fd75b71044.tar.bz2 |
bfd/elf.c strtab memory leak
* elf.c (_bfd_elf_compute_section_file_positions): Free strtab
on set_group_contents failure return path.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |