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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/19/2011 03:54 AM, Daniel P. Berrange wrote:
On Tue, Jul 19, 2011 at 05:34:28PM +0800, ajia@xxxxxxxxxx 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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]