[PATCH 3/5] remove deleted BFDs from the archive cache

Alan Modra amodra@gmail.com
Fri Aug 17 02:44:00 GMT 2012


On Thu, Aug 16, 2012 at 06:01:29PM -0700, H.J. Lu wrote:
>    amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
> -  ared = (struct areltdata *) bfd_zalloc (member, amt);
> +  /* Use xcalloc instead of bfd_zalloc so that areltdata is available
> +     to archive after objalloc_free is called on member memory.  */
> +  ared = (struct areltdata *) xcalloc (1, amt);

xcalloc shouldn't be called from within bfd.  I've already committed a
kneejerk patch to revert Tom's last change, instead using bfd_zmalloc
here.  Tom said he'd look into fixing the leak this causes, so I'm
happy to leave that to him.  :)

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list