diff options
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4236,7 +4236,11 @@ boolean _bfd_elf_close_and_cleanup (abfd) bfd *abfd; { - if (elf_shstrtab (abfd)) - _bfd_stringtab_free (elf_shstrtab (abfd)); + if (bfd_get_format (abfd) == bfd_object) + { + if (elf_shstrtab (abfd) != NULL) + _bfd_stringtab_free (elf_shstrtab (abfd)); + } + return _bfd_generic_close_and_cleanup (abfd); } |