[PATCH] dereferencing a freed pointer

Alan Modra amodra@bigpond.net.au
Tue Jul 24 04:03:00 GMT 2007

On Mon, Jul 23, 2007 at 05:58:41PM -0700, msnyder@sonic.net wrote:
> Flagged by Coverity.  If we don't set the pointer to NULL after calling
> bfd_stringtab_free, it may get called twice, in which case it will
> dereference a freed pointer.
> Unlikely perhaps, but possible.

The same goes for all the other buffers.  The problem was introduced
with Joseph's 2007-06-29 attribute patch, specifically
"goto error_return" on a bfd_malloc failure.  We should just return
false.  Patch to do so preapproved.

Alan Modra
Australia Development Lab, IBM

More information about the Binutils mailing list