...
According to the C Standard, tusing using the value of a pointer that refers to space deallocated by a call to the free()
or realloc()
function is undefined behavior (see undefined behavior 177).
...
CERT C Secure Coding Standard | MEM01-C. Store a new value in pointers immediately after free() |
CERT C++ Secure Coding Standard | MEM30MEM50-CPP. Do not access freed memory |
ISO/IEC TR 24772:2013 | Dangling References to Stack Frames [DCM] Dangling Reference to Heap [XYK] |
ISO/IEC TS 17961 | Accessing freed memory [accfree] |
MISRA C:2012 | Rule 18.6 (required) |
MITRE CWE |
...