4 ms·
"the assumption that free(NULL) won't corrupt the heap." That's not an assumption, that's how the free() function is defined to work by the language standard.
by mikeash 15y ago
"the assumption that free(NULL) won't corrupt the heap."
That's not an assumption, that's how the free() function is defined to work by the language standard. It never ceases to astound me how many otherwise good C programmers think free(NULL) is an error.