Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!emory!att!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Life after free? Keywords: free malloc Message-ID: <18339@haddock.ima.isc.com> Date: 29 Sep 90 07:02:45 GMT References: <5620@stpstn.UUCP> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Distribution: comp Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 16 In article <5620@stpstn.UUCP> lerman@stpstn.UUCP (Ken Lerman) writes: >In article quan@sol.surv.utas.oz (Stephen Quan) writes: >->Any comments on free-ing tmp before it is return-ed? > >Not only is it sensible, the semantics of free require it. No. An early manual once made the mistake of describing the local implementation instead of the interface%, but not all versions do it that way. Some modern systems still include such a guarantee, but only to provide backward compatibility to the programs that were foolish enough to depend on it. The Standard doesn't even guarantee that you can *look* at the value remaining in tmp, much less dereference it. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint ________ % Okay, I'm exaggerating a bit. It was a poorly-designed interface, though.