Dangling pointers can lead to exploitable double-free and access-freed-memory vulnerabilities. A simple yet effective way to eliminate dangling pointers and avoid many memory related vulnerabilities is to set pointers to NULL after they have been freed, or to another valid object.
Calling free() on a null NULL pointer results in no action being taken by free().
...
As stated above, calling free() on a null NULL pointer results in no action being taken by free(). Setting message to NULL after it has been freed eliminates the possibility that the message pointer can be used to free the same memory more than once.
...
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
MEM01-A | 3 ( high ) | 2 ( probable ) | 3 ( low ) | P18 | L1 |
Related Vulnerabilities
...