diff options
author | Scott MacVicar <scottmac@php.net> | 2008-01-28 16:09:08 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2008-01-28 16:09:08 +0000 |
commit | a7dabd575a1e852999ed9a64341e07737f48ec81 (patch) | |
tree | 0c0b84df5a03c5c1e9c4004138554f471d6a792f | |
parent | 47e009d3929761f1b0aea28a211d5deffceb0f73 (diff) | |
download | php-git-a7dabd575a1e852999ed9a64341e07737f48ec81.tar.gz |
MFH: 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 9730d401fb..a5699252b1 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -593,6 +593,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 { |