scottmac Mon Jan 28 16:08:15 2008 UTC
Modified files:
/php-src/main SAPI.c
Log:
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.228&r2=1.229&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.228 php-src/main/SAPI.c:1.229
--- php-src/main/SAPI.c:1.228 Mon Dec 31 07:12:18 2007
+++ php-src/main/SAPI.c Mon Jan 28 16:08:14 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.228 2007/12/31 07:12:18 sebastian Exp $ */
+/* $Id: SAPI.c,v 1.229 2008/01/28 16:08:14 scottmac Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -616,6 +616,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