mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 20:41:27 -04:00
Fix an unlikely but possible error case for http connections
Found by coverity
This commit is contained in:
parent
69b5c64704
commit
f22049e359
6
http.c
6
http.c
@ -1419,6 +1419,12 @@ evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (evcon->fd == -1) {
|
||||||
|
event_debug(("%s: bufferevent_getfd returned -1",
|
||||||
|
__func__));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if the connection completed */
|
/* Check if the connection completed */
|
||||||
if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
|
if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
|
||||||
&errsz) == -1) {
|
&errsz) == -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user