mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 20:07:56 -04:00
Fix an fd leak in evconnlistener_new_bind().
This commit is contained in:
parent
4c8b7cdc64
commit
24fb502f70
@ -158,8 +158,10 @@ evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb,
|
||||
fd = socket(family, SOCK_STREAM, 0);
|
||||
if (fd == -1)
|
||||
return NULL;
|
||||
if (evutil_make_socket_nonblocking(fd) < 0)
|
||||
if (evutil_make_socket_nonblocking(fd) < 0) {
|
||||
EVUTIL_CLOSESOCKET(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (flags & LEV_OPT_CLOSE_ON_EXEC) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user