mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-05 02:10:19 -04:00
Do not close(-1) when freeing an uninitialized socket bufferevent
This commit is contained in:
parent
70a44b61bb
commit
b34abf3069
@ -559,7 +559,7 @@ be_socket_destruct(struct bufferevent *bufev)
|
||||
event_del(&bufev->ev_read);
|
||||
event_del(&bufev->ev_write);
|
||||
|
||||
if (bufev_p->options & BEV_OPT_CLOSE_ON_FREE)
|
||||
if ((bufev_p->options & BEV_OPT_CLOSE_ON_FREE) && fd >= 0)
|
||||
EVUTIL_CLOSESOCKET(fd);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user