Date: Fri, 19 Sep 1997 18:38:57 +0930 From: Greg Lehey <grog@lemis.com> To: Graham Wheeler <gram@cdsec.com> Cc: Terry Lambert <tlambert@primenet.com>, hackers@FreeBSD.ORG Subject: Re: Bug in malloc/free (was: Memory leak in getservbyXXX?) Message-ID: <19970919183857.13258@lemis.com> In-Reply-To: <199709190815.KAA01865@cdsec.com>; from Graham Wheeler on Fri, Sep 19, 1997 at 10:15:05AM %2B0200 References: <199709182114.OAA13613@usr03.primenet.com> <199709190815.KAA01865@cdsec.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 19, 1997 at 10:15:05AM +0200, Graham Wheeler wrote: >> >> How about: >> >> heap_ptr p = malloc( 20); >> heap_ptr q, r; >> free(p); >> q = malloc(10) >> r = malloc( 10); >> free(p); >> >> ? 8-). > > Well, in this case q is typically equal to p. So the call to free(p) is > not a heap error (even though it is logically an error). > Would one call this a `Godel error'? ;-) Would alloca help, possibly? It allocates memory on the stack. Greg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970919183857.13258>