[9609] in Athena Bugs

home help back first fref pref prev next nref lref last post

rt 7.4G: memory leak in BSD setenv()

daemon@ATHENA.MIT.EDU (Barr3y Jaspan)
Mon Jul 13 15:57:41 1992

Date: Mon, 13 Jul 92 15:57:31 -0400
From: "Barr3y Jaspan" <bjaspan@Athena.MIT.EDU>
To: jik@pit-manager.MIT.EDU
Cc: bugs@Athena.MIT.EDU
In-Reply-To: "Jonathan I. Kamens"'s message of Mon, 13 Jul 92 15:30:50 -0400 <9207131930.AA23656@pit-manager.MIT.EDU>


The initial environment vector is passed in by the OS so no, it cannot
be freed.  However, there is nothing preventing setenv() from keeping
track of which variables it malloc()ed itself and freeing them as
appropriate.  It already does something like this with the array of
pointers.

Perhaps the memory leak is better than the additional overhead to keep
track of things as I suggest.

home help back first fref pref prev next nref lref last post