scottmac                Mon Jan 28 16:09:08 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/main       SAPI.c 
  Log:
  MFH: Fixed bug #43954 (Memory leak when sending the same HTTP status code 
more than once.)
  
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.202.2.7.2.15.2.2&r2=1.202.2.7.2.15.2.3&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.202.2.7.2.15.2.2 
php-src/main/SAPI.c:1.202.2.7.2.15.2.3
--- php-src/main/SAPI.c:1.202.2.7.2.15.2.2      Mon Dec 31 07:17:17 2007
+++ php-src/main/SAPI.c Mon Jan 28 16:09:08 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: SAPI.c,v 1.202.2.7.2.15.2.2 2007/12/31 07:17:17 sebastian Exp $ */
+/* $Id: SAPI.c,v 1.202.2.7.2.15.2.3 2008/01/28 16:09:08 scottmac Exp $ */
 
 #include <ctype.h>
 #include <sys/stat.h>
@@ -593,6 +593,10 @@
                && !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 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to