You can't free a NULL pointer. Some systems/libc's/compiler make it a NOOP, others will crash. You can not rely on this to work.