Date: Mon, 16 Nov 2009 13:26:41 +0100 From: Gary Jennejohn <gary.jennejohn@freenet.de> To: Jim Wilcoxson <prirun@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: acl_from_text leaking memory Message-ID: <20091116132641.6340432b@ernst.jennejohn.org> In-Reply-To: <c5830b750911150847r3698b21ey819d4de3312ef78d@mail.gmail.com> References: <c5830b750911150804i694b00aai891819242816e89c@mail.gmail.com> <c5830b750911150847r3698b21ey819d4de3312ef78d@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 15 Nov 2009 11:47:28 -0500 Jim Wilcoxson <prirun@gmail.com> wrote: > I've been working on a new backup program, HashBackup, and believe I > have found a memory leak with ACLs in PCBSD/FreeBSD 7.1 and OSX > (Leopard). > > acl_from_text is a function that takes a text string as input, and > returns a pointer to a malloc'd acl. This acl is then freed with > acl_free. I noticed that acl_from_text appears to leak memory. This > is not used during the backup of a filesystem, but is needed to do a > restore. > > After looking at the acl_from_text source in /usr/src/lib/libc/posix1e > (from PCBSD7.1), I believe the problem is that the duplicate text > string, mybuf_p, is not freed on normal return of this function. Here > is the end of this function: > [snip code] Looks to me like you're right. Have you tried applying the suggested change and testing it for regressions? Reporting that it works without side effects would definitely be convincing and increase the chances of getting it committed. --- Gary Jennejohn
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091116132641.6340432b>