[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: acl_from_text leaking memory
From:       volker () vwsoft ! com
Date:       2009-11-16 22:01:11
Message-ID: 4B01CBA7.8030308 () vwsoft ! com
[Download RAW message or body]

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 <gary.jennejohn@freenet.de> 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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic