Date: Mon, 7 Apr 1997 14:09:47 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: current@freebsd.org Subject: Humorous memory leak Message-ID: <199704072109.OAA02169@phaeton.artisoft.com>
next in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704072109.OAA02169>