Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: how do you know 'free' freed? Summary: use the malloc tracing routines and/or nullify the data Keywords: free, malloc, memory, allocation Message-ID: <1269@virtech.UUCP> Date: 13 Oct 89 01:46:51 GMT References: <5521@hacgate.UUCP> Organization: Virtual Technologies Inc Lines: 18 In article <5521@hacgate.UUCP>, howard@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 | +-----------------------------------------------------------------------+