how do you know 'free' freed?

Conor P. Cahill cpcahil at virtech.UUCP
Fri Oct 13 11:46:51 AEST 1989


In article <5521 at hacgate.UUCP>, howard at aic.dpl.scg.hac.com (Mike Howard (213)317-5690) writes:
> I've malloc'd a tree structure, and then free'd it, node by node.
> Of course, freeing it just marks it as free, and I can still walk
> through the tree after freeing it.  I'd like to confirm that it is
> in fact free.


You could use the malloc tracing routines available on usenet in
comp.sources.unix/volume18/malloc-trace.Z.  Another thing you 
could do is to nullify each allocated data block before freeing
it.   That way you couldn't wall through the tree again.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.lang.c mailing list