From 542031e8a3aa3750715cc0e5969a26af0b0b62d9 Mon Sep 17 00:00:00 2001 From: Thomas Porzelt Date: Sat, 28 Mar 2009 02:11:05 +0100 Subject: [PATCH] fix memory leak in response_send_headers() --- src/response.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/response.c b/src/response.c index 92e347c..d5111c8 100644 --- a/src/response.c +++ b/src/response.c @@ -21,7 +21,7 @@ void response_clear(response *resp) { } void response_send_headers(connection *con) { - GString *head = g_string_sized_new(8*1024); + GString *head; vrequest *vr = con->mainvr; if (vr->response.http_status < 100 || vr->response.http_status > 999) { @@ -31,6 +31,8 @@ void response_send_headers(connection *con) { return; } + head = g_string_sized_new(8*1024); + if (0 == con->out->length && con->mainvr->handle_response_body == NULL && vr->response.http_status >= 400 && vr->response.http_status < 600) {