This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: elfcode.h memory leak?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]