Until today I lived in belief that calling free()
on memory space releases it for further allocation without any other modifications. Especially, considering th
free()
does not zero memory as a general rule. It simply releases it for re-used by a future call to malloc()
. Certain implementations may fill the memory with known values but that is purely an implementation detail of the library.
Microsoft's runtime makes good use of marking freed and allocated memory with useful values (see In Visual Studio C++, what are the memory allocation representations? for more information). I have also seen it filled with values that when executed would cause a well-defined trap.