Many C code freeing pointers calls:
if (p)
free(p);
But why? I thought C standard say the free
function doesn\'t do anything
there can be a custom implementation of free() in mobile environment. In that case free(0) can cause a problem. (yeah, bad implementation)
As I understand, the no-op on NULL was not always there.
In the bad old days of C (back around 1986, on a pre-ANSI standard cc compiler) free(NULL) would dump core. So most devs tested for NULL/0 before calling free.
The world has come a long way, and it appears that we don't need to do the test anymore. But old habits die hard;)
http://discuss.joelonsoftware.com/default.asp?design.4.194233.15