[libvirt] [PATCH v2] util: avoid fds leak when virEventPollAddHandle fail

Eric Blake eblake at redhat.com
Tue Jul 19 13:25:27 UTC 2011


On 07/19/2011 03:54 AM, Daniel P. Berrange wrote:
> On Tue, Jul 19, 2011 at 05:34:28PM +0800, ajia at redhat.com wrote:
>> * src/util/event_poll.c: only fix file descriptors leak on when
>>    virEventPollAddHandle fail on virEventPollInit function.
>>
>> @@ -657,6 +658,8 @@ int virEventPollInit(void)
>>           virEventError(VIR_ERR_INTERNAL_ERROR,
>>                         _("Unable to add handle %d to event loop"),
>>                         eventLoop.wakeupfd[0]);
>> +        VIR_FORCE_CLOSE(eventLoop.wakeupfd[0]);
>> +        VIR_FORCE_CLOSE(eventLoop.wakeupfd[1]);
>>           return -1;
>>       }
>
> ACK, if the commit message is updated

v3 updated the commit message appropriately, so I've now pushed it.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list