From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 16 21:21:02 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 30BFD1065679 for ; Mon, 16 Nov 2009 21:21:02 +0000 (UTC) (envelope-from prirun@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id BA9978FC17 for ; Mon, 16 Nov 2009 21:21:01 +0000 (UTC) Received: by fxm27 with SMTP id 27so6510975fxm.3 for ; Mon, 16 Nov 2009 13:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Lt7ywxiePBtysEJfZ7ogIBXeEmSS2XlEdXq8ZcdKZfs=; b=fcapPOmVKcPAsef60xLAPh70SS6MzpKWnOTToSprytc6SnT+G8u297OtiGtza5AKmF FsrvEIkE0DQqj3OeYu8xWb1fZNJ0sMRg3iph5dqhngqFlwhq1fZd2Jo5ZcoXTum0TxoK iCUlpp9LiEm83SCGswxi0L8b6pd8iXO+lbWrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=jn5OIJ2HUSovMd2vNiFxMVrFJbMU6YixkAk4qLz6ekY377IIPa1Jughb/DCcw7mFy6 X5c5gEXL0XExIVIu340qAPGfLN6tQryAy+EEm5mASY4NiWEXNsFvwGVEVIhHCeeAWaMf ve5btZTP9cFeU5zUMbg/bAQybq+ht9B2C2ehE= MIME-Version: 1.0 Received: by 10.223.14.13 with SMTP id e13mr1278572faa.85.1258406460746; Mon, 16 Nov 2009 13:21:00 -0800 (PST) In-Reply-To: <20091116214202.480a0aa7@ernst.jennejohn.org> References: <4B01B23F.8040002@vwsoft.com> <20091116214202.480a0aa7@ernst.jennejohn.org> Date: Mon, 16 Nov 2009 16:21:00 -0500 Message-ID: From: Jim Wilcoxson To: gary.jennejohn@freenet.de Content-Type: text/plain; charset=ISO-8859-1 Cc: volker@vwsoft.com, 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 21:21:02 -0000 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 >