From 3e55a529260b57ff178a82af4aba4d983b4f0d16 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Fri, 19 Dec 2008 21:41:03 +0000 Subject: [PATCH] Fix a memory leak with http connections owned by the server. svn:r965 --- ChangeLog | 1 + http.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index e887bea0..f3e16d1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Changes in 1.4.9-stable: o Clear the timer cache when leaving the event loop; reported by Robin Haberkorn o Fix a typo in setting the global event base; reported by lance. o Fix a memory leak when reading multi-line headers + o Fix a memory leak with http connections owned by the server. Changes in 1.4.8-stable: o Match the query in DNS replies to the query in the request; from Vsevolod Stakhov. diff --git a/http.c b/http.c index 0dfed985..f0d0d365 100644 --- a/http.c +++ b/http.c @@ -1092,6 +1092,8 @@ evhttp_detect_close_cb(int fd, short what, void *arg) { struct evhttp_connection *evcon = arg; evhttp_connection_reset(evcon); + if (evcon->http_server && evcon->state == EVCON_READING_FIRSTLINE) + evhttp_connection_free(evcon); } static void