bfrance Thu Oct 12 20:02:58 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/sapi/apache mod_php5.c
Log:
Memory assigned to the request_rec should be allocated from apache pools
and should not be free'ed at the end of the handler phase
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/mod_php5.c?r1=1.19.2.7.2.5&r2=1.19.2.7.2.6&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.19.2.7.2.5
php-src/sapi/apache/mod_php5.c:1.19.2.7.2.6
--- php-src/sapi/apache/mod_php5.c:1.19.2.7.2.5 Thu Aug 3 09:56:50 2006
+++ php-src/sapi/apache/mod_php5.c Thu Oct 12 20:02:58 2006
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.19.2.7.2.5 2006/08/03 09:56:50 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.19.2.7.2.6 2006/10/12 20:02:58 bfrance Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -209,7 +209,6 @@
static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers
TSRMLS_DC)
{
request_rec *r = SG(server_context);
- char *status_buf = NULL;
const char *sline = SG(sapi_headers).http_status_line;
int sline_len;
@@ -223,11 +222,10 @@
* the status-code: */
if (sline && ((sline_len = strlen(sline)) > 12) && strncmp(sline,
"HTTP/1.", 7) == 0 && sline[8] == ' ' && sline[12] == ' ') {
if ((sline_len - 9) > MAX_STATUS_LENGTH) {
- status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH);
+ r->status_line = ap_pstrndup(r->pool, sline + 9,
MAX_STATUS_LENGTH);
} else {
- status_buf = estrndup(sline + 9, sline_len - 9);
+ r->status_line = ap_pstrndup(r->pool, sline + 9,
sline_len - 9);
}
- r->status_line = status_buf;
}
if(r->status==304) {
@@ -235,9 +233,6 @@
} else {
send_http_header(r);
}
- if (status_buf) {
- efree(status_buf);
- }
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php