From b8f43d6c72a95554022b7af808a50b6dd726c87b Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 5 May 2005 14:25:23 +0000 Subject: * dwarf2.c (read_abbrevs): If bfd_realloc fails, free currently allocated memory before returning. (decode_line_info): Likewise. (_bfd_dwarf2_cleanup_debug_info): New function: Frees memory allocated by functions in this file. * elf-bfd.h (_bfd_dwarf2_cleanup_debug_info): Prototype. * elf.c (bfd_elf_close_and_cleanup): Call _bfd_dwarf2_cleanup_debug_info. --- bfd/elf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index c2e84387bd6..5477ba633a1 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -6684,6 +6684,8 @@ _bfd_elf_close_and_cleanup (bfd *abfd) _bfd_elf_strtab_free (elf_shstrtab (abfd)); } + _bfd_dwarf2_cleanup_debug_info (abfd); + return _bfd_generic_close_and_cleanup (abfd); } -- cgit v1.2.1