elfcode.h memory leak?

Alan Modra alan@linuxcare.com.au
Fri Mar 23 22:20:00 GMT 2001


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



More information about the Binutils mailing list