This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

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


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


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