Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: validity of free() on later pointer operations Message-ID: <316@taumet.com> Date: 12 Jul 90 21:42:23 GMT References: <1990Jul3.185032.8434@indetech.com> <1990Jul03.233255.2616@virtech.uucp> <1956@runxtsa.runx.oz.au> Organization: Taumetric Corporation, San Diego Lines: 14 edward@runxtsa.runx.oz.au (Edward Birch) writes: >I quote the manual here: > The argument to "free" is a pointer to a block previosly allocated > by "malloc"; after "free" is performed this space is made available > for further allocation, but its contents are left undisturbed. I wonder which manual that is. ANSI C makes no such guarantee. See section 4.10.3 of the standard. As Mr Birch also pointed out, if you play games with malloc/free, don't expect your whiz-bang code to run on another system. -- Steve Clamage, TauMetric Corp, steve@taumet.com