Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by coverity

This commit is contained in:
Nick Mathewson 2012-07-26 10:44:48 -04:00
parent 9852107f37
commit 6487f63b79

View 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) {