Path: utzoo!attcan!uunet!van-bc!jtc From: jtc@van-bc.wimsey.bc.ca (J.T. Conklin) Newsgroups: comp.lang.c Subject: Re: Life after free? Message-ID: <2384@van-bc.wimsey.bc.ca> Date: 5 Oct 90 14:42:07 GMT References: <623@demott.COM> <5360:Oct421:09:4890@kramden.acf.nyu.edu> <1990Oct5.002416.3196@nntp-server.caltech.edu> Organization: UniFax Communications Inc., Vancouver, B.C., Canada Lines: 22 In article <1990Oct5.002416.3196@nntp-server.caltech.edu> manning@nntp-server.caltech.edu (Evan Marshall Manning) writes: >You're missing the point. Of course you can do what you like with your >data. But when you free() it you return it to the OS. And anybody else >can end up with your data when they next malloc(). In most systems, free()ed memory is not returned to the OS, it is placed in malloc()'s unallocated memory pool to be assigned at some subsequent malloc(). The time that memory is typically cleared, is when malloc() cannot satisfy a request from its pool, and has to request more from the OS with sbrk(). The OS then clears the memory before it is passed to the process. --jtc -- J.T. Conklin UniFax Communications Inc. ...!{uunet,ubc-cs}!van-bc!jtc, jtc@wimsey.bc.ca