From 352c3a7f1b44da70c01224cd062617318fa53e05 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Mon, 28 Jan 2008 16:08:14 +0000 Subject: [PATCH] Fixed bug #43954 (Memory leak when sending the same HTTP status code more than once.) --- main/SAPI.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/SAPI.c b/main/SAPI.c index 3019ddd150..f4c8d7525e 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -616,6 +616,10 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) && !strncasecmp(header_line, "HTTP/", 5)) { /* filter out the response code */ sapi_update_response_code(sapi_extract_response_code(header_line) TSRMLS_CC); + /* sapi_update_response_code doesn't free the status line if the code didn't change */ + if (SG(sapi_headers).http_status_line) { + efree(SG(sapi_headers).http_status_line); + } SG(sapi_headers).http_status_line = header_line; return SUCCESS; } else { -- 2.50.1