...
The specific characteristics of these routines are based on the compiler used. With a few exceptions, this document considers only the general and compiler-independent attributes of these routines.
Recommendations
MEM00-A. Allocate and free memory in the same module, at the same level of abstraction
MEM01-A. Set pointers to dynamically allocated memory to NULL after they are released
Rules
MEM30-C. Do not access freed memory
...
MEM37-C. Ensure that size arguments to calloc() do not result in an arithmetic overflow
References
- ISO/IEC 9899-1999 7.20.3 Memory management functions
- Seacord 05 Chapter 4 Dynamic Memory Management