* elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we

have a bfd_object.
This commit is contained in:
Ian Lance Taylor
1998-01-28 18:42:54 +00:00
parent 0f1ec0f95f
commit e6e3d4bdf4
2 changed files with 13 additions and 4 deletions

View File

@@ -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);
}