Hacker News new | ask | show | jobs
by po1nt 263 days ago
It shouldn't https://pubs.opengroup.org/onlinepubs/7908799/xsh/free.html

>If ptr is a null pointer, no action occurs.

1 comments

While I agree it shouldn't, that particular document is the UNIX specification, not the C specification, so it does not apply to C compilers on non-UNIX platforms.
free(NULL) is a noop ever since C89 (I was on the standards committee, X3J11).