PR26069, strip/objcopy memory leaks
[deliverable/binutils-gdb.git] / bfd / elf.c
index e335ff7efbfd8d19f18dc0c6a44332907ad5ec97..9ca42e10d8e5b28090d6ce73cc65fbd456210123 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9438,7 +9438,9 @@ bfd_boolean
 _bfd_elf_close_and_cleanup (bfd *abfd)
 {
   struct elf_obj_tdata *tdata = elf_tdata (abfd);
-  if (bfd_get_format (abfd) == bfd_object && tdata != NULL)
+  if (tdata != NULL
+      && (bfd_get_format (abfd) == bfd_object
+         || bfd_get_format (abfd) == bfd_core))
     {
       if (elf_tdata (abfd)->o != NULL && elf_shstrtab (abfd) != NULL)
        _bfd_elf_strtab_free (elf_shstrtab (abfd));
This page took 0.027205 seconds and 4 git commands to generate.