This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH : free(NULL) in cpphash.c
- To: zack at wolery dot cumb dot org (Zack Weinberg)
- Subject: Re: PATCH : free(NULL) in cpphash.c
- From: "Philippe De Muyter" <phdm at macqel dot be>
- Date: Wed, 5 Apr 2000 06:58:53 +0200 (CEST)
- Cc: gcc-patches at gcc dot gnu dot org
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, ).
Philippe