This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: PATCH : free(NULL) in cpphash.c


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

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