3 ms·
Writing random values to freed memory would mostly work, at some cost to performance. The memory could get allocated again before it is re-used, and whatever i
by ncmncm 4y ago
Writing random values to freed memory would mostly work, at some cost to performance.
The memory could get allocated again before it is re-used, and whatever is put in it might be less trappy than a random value. And, of course, a random value might not trap.
Better is not to do things that result in referring to dead memory: easy in modern C++, apparently difficult in C.