Date: Fri, 7 Aug 1998 18:12:18 -0400 From: Garance A Drosihn <drosih@rpi.edu> To: Archie Cobbs <archie@whistle.com> Cc: freebsd-current@FreeBSD.ORG Subject: Re: memory leaks in libc Message-ID: <v04011705b1f1295590a6@[128.113.24.47]> In-Reply-To: <199808071951.MAA04454@bubba.whistle.com> References: <3224.902516512@critter.freebsd.dk> from Poul-Henning Kamp at "Aug 7, 98 09:01:52 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
At 12:51 PM -0700 8/7/98, Archie Cobbs wrote: >Poul-Henning Kamp writes: >> >I just don't understand where you're coming from. There is a clear >> >bug in the standard library, we agree on this right? You are saying >> >that it's not worth fixing, because... >> >> I think there is agreement that a bogus API was defined long time ago, >> and since getting rid of that API not worth even discussing, this >> entire thread is a waste of time. > > ? Who's talking about changing the API? I think you're misunderstanding > the issue. The issue is simply: there's a memory leak in libc, should we > or should we not fix it? It's a standard bug-fix cost/benefit question. The memory leak is not due to a bug in libc, it's due to a bug in the definition of the API. The only way to reliably fix this problem is to create different, well-defined routines which provide a similar benefit. In this case, the API should have included important information on what programs could expect from the pointer returned from "getenv" (such as, whether they can just save that pointer and expect it to remain valid for the life of the program, even if some later call to setenv will change the value pointed at by **environ). It should have also hidden away **environ, so programs can't directly manipulate that global variable without setenv/getenv/putenv knowing about it. --- Garance Alistair Drosehn = gad@eclipse.its.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v04011705b1f1295590a6>