This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: elfcode.h memory leak?
- To: Doug Evans <dje at transmeta dot com>
- Subject: Re: elfcode.h memory leak?
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Sat, 24 Mar 2001 17:20:37 +1100 (EST)
- cc: binutils at sourceware dot cygnus dot com
On Fri, 23 Mar 2001, Doug Evans wrote:
> elf_slurp_symbol_table has this:
>
> symbase = ((elf_symbol_type *)
> bfd_zalloc (abfd, symcount * sizeof (elf_symbol_type)));
>
> Who's responsibility is it to free `symbase'?
bfd_zalloc allocates an obstack, so bfd_free on it will deallocate all
later obstacks for the bfd too. That might not be a good idea. :)
Alan Modra
--
Linuxcare