]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #43954 (Memory leak when sending the same HTTP status code more than...
authorScott MacVicar <scottmac@php.net>
Mon, 28 Jan 2008 16:12:55 +0000 (16:12 +0000)
committerScott MacVicar <scottmac@php.net>
Mon, 28 Jan 2008 16:12:55 +0000 (16:12 +0000)
NEWS
main/SAPI.c

diff --git a/NEWS b/NEWS
index 178722681c8eaa5e27f70869800c74f5b1b88433..f95f70d2d4ca28fabb04add5061f5cb3ad7e7b93 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP                                                                        NEWS
   which to group by data is specified. (Ilia)
 - Upgraded PCRE to version 7.5 (Nuno)
 
+- Fixed bug #43954 (Memory leak when sending the same HTTP status code
+  multiple times). (Scott)
 - Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream filter). 
   (Greg)
 - Fixed bug #43912 (Interbase column names are truncated to 31 characters).
index 9730d401fb8d659646e67fcc64b80be50ba1cb20..a5699252b1f4dd4a87cf16fda468400bce4a35d9 100644 (file)
@@ -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 {