Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2001 19:47:45 +0000
From:      Bob Bishop <rb@gid.co.uk>
To:        Alfred Perlstein <bright@mu.org>
Cc:        hackers@freebsd.org
Subject:   Re: Committer please
Message-ID:  <l03130304b80c9851ff88@[194.32.164.2]>
In-Reply-To: <20011105130328.G89342@elvis.mu.org>
References:  <4.3.2.7.2.20011105121057.00bace90@gid.co.uk>; from rb@gid.co.uk on Mon, Nov 05, 2001 at 12:33:13PM %2B0000 <4.3.2.7.2.20011105121057.00bace90@gid.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

At 13:03 -0600 5/11/01, Alfred Perlstein wrote:
>* Bob Bishop <rb@gid.co.uk> [011105 06:35] wrote:
>> Hi,
>>
>> Would some kind committer please have a look at bin/31533: /bin/sh memory
>> leak. There is a patch there which I believe is OK. Having a memory leak
>> loose in the shell seems like a Bad Idea to me. TIA
>
>Understandable, things like this could be applied more quickly if
>someone would take the time to explain what the delta does other
>than fix the problem.  Meaning, what is VTEXTFIXED, and what does
>removing it change?

According to src/bin/sh/var.h:

#define VTEXTFIXED      0x08    /* text is staticly allocated */

(in the text member of struct var, that is).

prevdir and curdir in the region of the patch are dynamically allocated,
but with VFIXEDTEXT their storage would not be freed when superseded (see
var.c:319). Hence the leak.

Apologies for the lazy submission. I posted the PR. Maxim suggested the
patch. I tried it. It worked. Mea culpa. Now my consciemnce is troubling
me, I've just started a make world with the patch in...


--
Bob Bishop              (0118) 977 4017  international code +44 118
rb@gid.co.uk        fax (0118) 989 4254



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?l03130304b80c9851ff88>