[SSSD] [PATCH] File descriptor leak in nss responder.

Michal Židek mzidek at redhat.com
Wed Mar 6 22:19:10 UTC 2013


On 03/06/2013 08:13 PM, Simo Sorce wrote:
> On Wed, 2013-03-06 at 19:33 +0100, Michal Židek wrote:
>> On 03/06/2013 07:27 PM, Michal Židek wrote:
>>> On 03/06/2013 07:18 PM, Michal Židek wrote:
>>>> On 03/06/2013 06:33 PM, Simo Sorce wrote:
>>>>> On Wed, 2013-03-06 at 17:09 +0100, Michal Židek wrote:
>>>>>> https://fedorahosted.org/sssd/ticket/1826
>>>>>>
>>>>>> See commit message.
>>>>>
>>>>> It would be better if you can use a destructor attached to the mc_ctx
>>>>> so any other path where we need to free it is automatically covered.
>>>>>
>>>>> Simo.
>>>>>
>>>>
>>>> New patch attached.
>>>>
>>>> Thanks
>>>> Michal
>>>>
>>>>
>>> There should be goto done, not ret... will send another patch soon.
>>>
>>
>> Here it is.
>
> The destructors can return only 0 or -1.
>
> And they shoul return -1 exclusively when they want to make the
> talloc_free() operation fail.
>
> In this case we should probably never return anything but 0, because
> even on failure we want to still free the mc_ctx.
>

OK.

> Also I think failing to close the file or unmapping should be major
> failures (much higher debug level) as they cause memory/resource leaks
> that will quickly make the process unusuable.

I changed it to critical failure.

>
> Simo.
>

Thanks
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-File-descriptor-leak-in-nss-responder.patch
Type: text/x-patch
Size: 2562 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130306/a1961c2d/attachment.bin>


More information about the sssd-devel mailing list