PATCH : free(NULL) in cpphash.c

Zack Weinberg zack@wolery.cumb.org
Tue Apr 4 22:11:00 GMT 2000


On Wed, Apr 05, 2000 at 06:58:53AM +0200, Philippe De Muyter wrote:
> Zack Weinberg wrote :
> > free(NULL) is defined to be a no-op, so the code should be safe as is.
> 
> No, free(NULL) can crash the program with many old malloc implementations.
> That is also valid for realloc(NULL, ).

That possibility occurred to me about five seconds after I sent the
previous message.  I will definitely apply the patch, but can you
please send me a piece of sample input that triggers the bug?  I don't
have an old malloc implementation around to test with.

zw


More information about the Gcc-patches mailing list