| Summary: | /bin/sh with builtin 'test' has memory leaks | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Eugene Grosbein <ports> |
| Component: | bin | Assignee: | Maxim Konovalov <maxim> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | stable |
| Priority: | Normal | ||
| Version: | 4.6-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Eugene Grosbein
2002-07-04 11:20:04 UTC
Could you please try a patch below? Index: test/test.c =================================================================== RCS file: /home/ncvs/src/bin/test/test.c,v retrieving revision 1.29.2.5 diff -u -r1.29.2.5 test.c --- test/test.c 29 Apr 2002 13:06:02 -0000 1.29.2.5 +++ test/test.c 4 Jul 2002 10:33:31 -0000 @@ -240,6 +240,7 @@ syntax(*t_wp, "unexpected operator"); (void)setregid(gid, egid); (void)setreuid(uid, euid); + free(nargv); return res; } %%% -- Maxim Konovalov, MAcomnet, Internet Dept., system engineer phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru On Thu, Jul 04, 2002 at 02:35:42PM +0400, Maxim Konovalov wrote:
> Could you please try a patch below?
>
> Index: test/test.c
> ===================================================================
> RCS file: /home/ncvs/src/bin/test/test.c,v
> retrieving revision 1.29.2.5
> diff -u -r1.29.2.5 test.c
> --- test/test.c 29 Apr 2002 13:06:02 -0000 1.29.2.5
> +++ test/test.c 4 Jul 2002 10:33:31 -0000
> @@ -240,6 +240,7 @@
> syntax(*t_wp, "unexpected operator");
> (void)setregid(gid, egid);
> (void)setreuid(uid, euid);
> + free(nargv);
>
> return res;
> }
>
> %%%
Yes, it works. Thank you and Stefan Farfeleder for similar patch,
I tried only this one, though.
Eugene
State Changed From-To: open->patched Fixed in rev. 1.49 src/bin/test/test.c in -current. Responsible Changed From-To: freebsd-bugs->maxim I will MFC the fix in one week. A more correct patch was committed, rev. 1.51 src/bin/test/test.c. -- Maxim Konovalov, maxim@FreeBSD.org State Changed From-To: patched->closed Fixed in rev 1.51 and rev. 1.29.2.7 src/bin/test/test.c in -current and -stable. Thanks for the report. |