]> granicus.if.org Git - libevent/commitdiff
Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by coverity
authorNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:44:48 +0000 (10:44 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:44:48 +0000 (10:44 -0400)
listener.c

index a39c4dfccc91fd63a4388980d8f730e4c4b2b3da..276eb06eaeb2dd2b6e15cac80d4e21b26d474dfe 100644 (file)
@@ -239,7 +239,10 @@ evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb,
        }
 
        if (flags & LEV_OPT_DEFERRED_ACCEPT) {
-               evutil_make_tcp_listen_socket_deferred(fd);
+               if (evutil_make_tcp_listen_socket_deferred(fd) < 0) {
+                       evutil_closesocket(fd);
+                       return NULL;
+               }
        }
 
        if (sa) {