Is free(NULL) OK?

Hal Murray halmurray at sonic.net
Sun Jan 12 20:12:50 UTC 2025


Joel Sherrill said:
> POSIX says free(NULL) is valid and no action.

Right.  Thanks.

I should have been clearer on my question.  I'll try again.

Are there any crazy-old systems that we currently run on that will die if 
free() gets a NULL?

Checking for NULL seems like a very very handy feature so I'd be surprised 
if there were still any systems that didn't do that.  But I've been 
surprised before.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list