From owner-freebsd-current Thu Aug 6 18:46:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA27055 for freebsd-current-outgoing; Thu, 6 Aug 1998 18:46:12 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA27000 for ; Thu, 6 Aug 1998 18:46:02 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id SAA10235; Thu, 6 Aug 1998 18:42:30 -0700 (PDT) Message-Id: <199808070142.SAA10235@implode.root.com> To: "Andrew Reilly" cc: Bruce Evans , wollman@khavrinen.lcs.mit.edu, freebsd-current@FreeBSD.ORG Subject: Re: memory leaks in libc In-reply-to: Your message of "Fri, 07 Aug 1998 11:02:43 +1000." <19980807110243.A9734@reilly.home> From: David Greenman Reply-To: dg@root.com Date: Thu, 06 Aug 1998 18:42:30 -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >On Fri, Aug 07, 1998 at 03:23:29AM +1000, Bruce Evans wrote: >> >So you both agree, then, that there is no point in wasting any more >> >time on this? >> >> Not quite. It should be fixed someday. > >I always thought it odd that there were no implimentations of >free() that were able to identify whether the pointer that they >were passed was something that malloc had handed out previously. >Surely malloc's data structures must have something to say about >it. > >If free() could know this, then things like setenv could just go >ahead and call free(), and if the previous object had not been >malloc'ed then nothing would happen. If the string were malloced by the program (as opposed to the library), then it won't be expecting setenv() to do a hidden free(). This could lead to random memory corruption if the process modifies the freed memory. In all of this dicussion, I can't stop thinking that the cure sounds far worse than the disease. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message