From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 16 22:01:30 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F4F21065672 for ; Mon, 16 Nov 2009 22:01:30 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from Mail.elbekies.net (mail.elbekies.net [217.6.211.146]) by mx1.freebsd.org (Postfix) with ESMTP id 030438FC13 for ; Mon, 16 Nov 2009 22:01:29 +0000 (UTC) Received: from mail.vtec.ipme.de (C4906.c.ppp-pool.de [62.104.73.6]) by Mail.elbekies.net (Postfix) with ESMTPA id 7A91567885; Mon, 16 Nov 2009 23:01:20 +0100 (CET) Received: from [192.168.16.4] (dardanos.sz.vwsoft.com [192.168.16.4]) by mail.vtec.ipme.de (Postfix) with ESMTP id B8E5134278; Mon, 16 Nov 2009 23:01:12 +0100 (CET) Message-ID: <4B01CBA7.8030308@vwsoft.com> Date: Mon, 16 Nov 2009 23:01:11 +0100 From: volker@vwsoft.com User-Agent: Thunderbird 2.0.0.23 (X11/20090902) MIME-Version: 1.0 To: Jim Wilcoxson References: <4B01B23F.8040002@vwsoft.com> <20091116214202.480a0aa7@ernst.jennejohn.org> In-Reply-To: X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-VWSoft-MailScanner: Found to be clean X-MailScanner-ID: 7A91567885.AD58E X-Elbekies-MailScanner: Found to be clean X-MailScanner-From: volker@vwsoft.com MailScanner-NULL-Check: 1259013688.66949@301/zF2w6UTVSrwIYZ5VPg Cc: freebsd-hackers@freebsd.org Subject: Re: acl_from_text leaking memory X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2009 22:01:30 -0000 On 11/16/09 22:21, Jim Wilcoxson wrote: > The man page is correct and should not be changed. > > In the example program I submitted, it does call acl_free; this is not > where the leak occurs. The leak occurs because of a temporary string > that acl_from_text allocates to parse the text. > > Jim > > On 11/16/09, Gary Jennejohn wrote: >> On Mon, 16 Nov 2009 21:12:47 +0100 >> volker@vwsoft.com wrote: >> >>> you may want to have a look at the manpage acl_from_text(3): >>> >>> "...This function may cause memory to be allocated. The caller should >>> free any releasable memory, when the new ACL is no longer required, by >>> calling acl_free(3) with the (void *)acl_t as an argument." >>> >>> Please use an acl_free(void *obj_p) call afterwards to avoid leaking >>> memory. >>> >> The suggested fix was appplied to HEAD today. Apparently, the man page >> should >> now be updated. >> >> --- >> Gary Jennejohn >> > Yes, I see and c199317 fixed that leak correctly. Jim is right - the manpage still should not be changed as the caller is still responsible for free'ing allocated memory. Volker