As noted in [undefined behavior 169|CC. Undefined Behavior#ub_ 169] of Annex J of \ [[ISO/IEC 9899-1999|AA. Bibliography#ISO/IEC 9899-1999]\], the behavior a program is [undefined |BB. Definitions#undefined behavior] when Wiki Markup
the pointer argument to the
free
orrealloc
function does not match a pointer earlier returned bycalloc
,malloc
, orrealloc
, or the space has been deallocated by a call tofree
orrealloc
.
...
Tool | Version | Checker | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
| ||||||||||||
|
|
|
| ||||||||||||
|
|
|
| ||||||||||||
|
|
|
|
...
MITRE CWE: CWE-590, "Free of Invalid Pointer Not on the Heap"
Bibliography
\[[Seacord 2005|AA. Bibliography#Seacord 05] \] Chapter 4, "Dynamic Memory Management" Wiki Markup
...
MEM33-C. Allocate and copy structures containing flexible array members dynamically 08. Memory Management (MEM)