mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Fix potential fd leak in listener_read_cb()
As pointed out by harlan_ in #libevent after running a coverity sweep. If the listener is free'd, 'new_fd' is never closed.
This commit is contained in:
parent
c51b159cff
commit
571dbac81a
@ -421,6 +421,8 @@ listener_read_cb(evutil_socket_t fd, short what, void *p)
|
||||
if (lev->refcnt == 1) {
|
||||
int freed = listener_decref_and_unlock(lev);
|
||||
EVUTIL_ASSERT(freed);
|
||||
|
||||
evutil_closesocket(new_fd);
|
||||
return;
|
||||
}
|
||||
--lev->refcnt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user