diff options
| author | Scott MacVicar <scottmac@php.net> | 2008-01-28 16:08:14 +0000 |
|---|---|---|
| committer | Scott MacVicar <scottmac@php.net> | 2008-01-28 16:08:14 +0000 |
| commit | 352c3a7f1b44da70c01224cd062617318fa53e05 (patch) | |
| tree | 3760fd5278ebd9ad1853c414edaf2a857b3d628a | |
| parent | 9fd5c0b43830fe6f002204457916a3df5d941dd3 (diff) | |
| download | php-git-352c3a7f1b44da70c01224cd062617318fa53e05.tar.gz | |
Fixed bug #43954 (Memory leak when sending the same HTTP status code more than once.)
| -rw-r--r-- | main/SAPI.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 { |
