bfrance         Thu Oct 12 20:13:07 2006 UTC

  Modified files:              
    /php-src/sapi/apache        mod_php5.c 
  Log:
  
    MFB:
    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.38&r2=1.39&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.38 php-src/sapi/apache/mod_php5.c:1.39
--- php-src/sapi/apache/mod_php5.c:1.38 Thu Aug  3 09:57:05 2006
+++ php-src/sapi/apache/mod_php5.c      Thu Oct 12 20:13:07 2006
@@ -17,7 +17,7 @@
    | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>                      |
    +----------------------------------------------------------------------+
  */
-/* $Id: mod_php5.c,v 1.38 2006/08/03 09:57:05 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.39 2006/10/12 20:13:07 bfrance Exp $ */
 
 #include "php_apache_http.h"
 #include "http_conf_globals.h"
@@ -205,7 +205,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;
 
@@ -219,11 +218,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) {
@@ -231,9 +229,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

Reply via email to