This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Re: Multiple apparent leaks in dwarf2.c
- From: Nick Clifton <nickc at redhat dot com>
- To: John Levon <levon at movementarian dot org>
- Cc: binutils at sources dot redhat dot com, Philippe Elie <phil dot el at wanadoo dot fr>
- Date: Thu, 05 May 2005 15:24:08 +0100
- Subject: Re: [PATCH] Re: Multiple apparent leaks in dwarf2.c
- References: <20050421060339.GA86259@compsoc.man.ac.uk> <20050423205950.GA3035@compsoc.man.ac.uk>
Hi John,
Here's a patch that fixes up the issues I found in dwarf2.c. With this
patch applied to CVS, our application is valgrind-clean.
Thanks very much for submitting this. I have applied your patch
together with this ChangeLog entry:
bfd/ChangeLog
2005-05-05 John Levon <levon@movementarian.org>
* 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.
Cheers
Nick