[PATCH 1/5] fix the archive hash table memory leak

nick clifton nickc@redhat.com
Tue Aug 7 13:46:00 GMT 2012
Hi Tom,

> 	* archive.c (_bfd_delete_archive_data): New function.
> 	* libbfd-in.h (_bfd_delete_archive_data): Declare.
> 	* libbfd.h: Rebuild.
> 	* opncls.c (_bfd_delete_bfd): Call _bfd_delete_archive_data

Approved and applied.

Note - there was a small problem with the patch: 
_bfd_delete_archive_data was being called on bfds which were not 
archives (and hence bfd_ardata() returned a pointer to a structure that 
was not a struct artdata).  I fixed this by adding a test of the format 
in _bfd_delete_bfd before calling _bfd_delete_archive_data.

Cheers
   Nick



More information about the Binutils mailing list