]> granicus.if.org Git - libevent/commitdiff
close fd if evhttp_get_requestion_connection fails
authorNiels Provos <provos@gmail.com>
Tue, 24 Jun 2008 23:37:37 +0000 (23:37 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 24 Jun 2008 23:37:37 +0000 (23:37 +0000)
svn:r867

http.c

diff --git a/http.c b/http.c
index 6c230e6d1c088550997c4afaa7d190b0b64a347c..ded43c9e350fa0b85342d57f667316b6f7ac2a6f 100644 (file)
--- a/http.c
+++ b/http.c
@@ -2602,6 +2602,7 @@ evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
        evcon = evhttp_get_request_connection(http, fd, sa, salen);
        if (evcon == NULL) {
                event_warn("%s: cannot get connection on %d", __func__, fd);
+               EVUTIL_CLOSESOCKET(fd);
                return;
        }