bin/55346: /bin/sh eats memory and CPU infinitely
dwhite at gumbysoft.com
Fri Aug 15 19:13:58 PDT 2003
On Fri, 15 Aug 2003, Eugene Grosbein wrote:
> I think I've found a memory leak in /bin/sh.
> There is a case when dowait() and does frees resources of
> completed job correctly. Here is a patch:
Your idea has some merit but your patch does not conform to normal style.
> -#if JOBS
> if (done)
> - deljob(jp);
> + freejob(jp);
You should not remove the ifdef and change the indentation of deljob. Just
s/del/free and be done with it :-) I highly doubt anyone needs to disable
job control in sh, but in the off chance they do, you might as well keep
the ifdef around.
Note that freejob calls deljob.
Doug White | FreeBSD: The Power to Serve
dwhite at gumbysoft.com | www.FreeBSD.org
More information about the freebsd-stable