From: Scott MacVicar Date: Mon, 28 Jan 2008 16:08:14 +0000 (+0000) Subject: Fixed bug #43954 (Memory leak when sending the same HTTP status code more than once.) X-Git-Tag: RELEASE_2_0_0a1~750 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=352c3a7f1b44da70c01224cd062617318fa53e05;p=php Fixed bug #43954 (Memory leak when sending the same HTTP status code more than once.) --- 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 {