From owner-freebsd-bugs Sat May 13 22:26:59 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id WAA23852 for bugs-outgoing; Sat, 13 May 1995 22:26:59 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id WAA23846 for ; Sat, 13 May 1995 22:26:52 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id PAA15514; Sun, 14 May 1995 15:25:12 +1000 Date: Sun, 14 May 1995 15:25:12 +1000 From: Bruce Evans Message-Id: <199505140525.PAA15514@godzilla.zeta.org.au> To: freebsd-bugs@FreeBSD.org, henrich@crh.cl.msu.edu Subject: Re: login.c environ=envinit ? Sender: bugs-owner@FreeBSD.org Precedence: bulk >Im looking at login.c ~line 400 where we reset the user environment if the p >flag is passed, and we do this but just re-assigning the environment global. >Shouldnt we free the environment memory before doing that? Only if the environment memory was malloced. But there is no way for login to know. Only setenv() knows. Perhaps unsetenv((char *)0) should be a standard way of unsetting everything. unsetenv() currently doesn't even know if setenv() called malloc and doesn't free anything. Bruce