From 6487f63b79cfbc22262720ac6afbb51de819c2aa Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 26 Jul 2012 10:44:48 -0400 Subject: [PATCH] Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by coverity --- listener.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/listener.c b/listener.c index a39c4dfc..276eb06e 100644 --- a/listener.c +++ b/listener.c @@ -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) {