Originally Posted by
robatino
Any fairly recent and standards-compliant compiler shouldn't have this problem (although admittedly a lot of posters seem to be using compilers from the last century, so it needs to be mentioned). If the OP is having this problem he needs to get a newer one. The benefit of being able to use free(NULL) is to not have to call it conditionally - the people who wrote the standard evidently thought it was worthwhile enough to guarantee the behavior.
Edit: I know that internally the compiler just does the equivalent conditional execution of the instruction, but it's such a trivial thing to do that any compiler that doesn't do it properly probably either hasn't been updated in many years, or is maintained by someone who just doesn't care, either of which is a good reason not to use said compiler.