Here’s the chapter and verse.
If the argument [to the
free
function] does not match a pointer earlier returned by thecalloc
,malloc
, or
realloc
function, or if the space has been deallocated by a call tofree
orrealloc
,
the behavior is undefined. (ISO 9899:1999 – Programming languages — C, Section 7.20.3.2)