Fix an unlikely but possible error case for http connections

Found by coverity
This commit is contained in:
Nick Mathewson 2013-08-06 19:17:08 -04:00
parent 69b5c64704
commit f22049e359

6
http.c
View File

@ -1419,6 +1419,12 @@ evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg)
return;
}
if (evcon->fd == -1) {
event_debug(("%s: bufferevent_getfd returned -1",
__func__));
goto cleanup;
}
/* Check if the connection completed */
if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
&errsz) == -1) {