From owner-freebsd-current Mon Apr 7 14:28:13 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA14307 for current-outgoing; Mon, 7 Apr 1997 14:28:13 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id OAA14299 for ; Mon, 7 Apr 1997 14:28:05 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA02169 for current@freebsd.org; Mon, 7 Apr 1997 14:09:47 -0700 From: Terry Lambert Message-Id: <199704072109.OAA02169@phaeton.artisoft.com> Subject: Humorous memory leak To: current@freebsd.org Date: Mon, 7 Apr 1997 14:09:47 -0700 (MST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk There is a humorous memory leak in kern/kern_exec.c in execve(). The path name buffer in the "exec_fail_dealloc:" case should be unconditionally freed, not conditionally freed based on a valid ndp->ni_vp. The reason is that if the namei() succeeded with the "SAVENAME" flag set, then a path buffer is allocated independently of whether the ndp->ni_vp value is valid. Actually, I can't see why the test is really necessary at all; the fail-through should be to "exec_fail:" in any case that could result in a NULL ndp->ni_vp, right? Anyway, it's funny. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.