jani            Sun Jul 15 15:20:30 2007 UTC

  Modified files:              
    /php-src/main       main.c 
  Log:
  MFB: free error messages + ws fix
  
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.736&r2=1.737&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.736 php-src/main/main.c:1.737
--- php-src/main/main.c:1.736   Wed Jul 11 17:39:04 2007
+++ php-src/main/main.c Sun Jul 15 15:20:29 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.736 2007/07/11 17:39:04 johannes Exp $ */
+/* $Id: main.c,v 1.737 2007/07/15 15:20:29 jani Exp $ */
 
 /* {{{ includes
  */
@@ -564,8 +564,9 @@
        } else if (php_during_module_shutdown()) {
                stage = "PHP Shutdown";
        } else if (EG(current_execute_data) &&
-                  EG(current_execute_data)->opline &&
-                  EG(current_execute_data)->opline->opcode == 
ZEND_INCLUDE_OR_EVAL) {
+                               EG(current_execute_data)->opline &&
+                               EG(current_execute_data)->opline->opcode == 
ZEND_INCLUDE_OR_EVAL
+       ) {
                switch 
(EG(current_execute_data)->opline->op2.u.constant.value.lval) {
                        case ZEND_EVAL:
                                function.s = "eval";
@@ -940,9 +941,10 @@
                        EG(exit_status) = 255;
                        if (module_initialized) {
                                if (!SG(headers_sent) &&
-                                   SG(sapi_headers).http_response_code == 200) 
{
+                                       SG(sapi_headers).http_response_code == 
200
+                               ) {
                                        sapi_header_line ctr = {0};
-       
+
                                        ctr.line = "HTTP/1.0 500 Internal 
Server Error";
                                        ctr.line_len = strlen(ctr.line);
                                        sapi_header_op(SAPI_HEADER_REPLACE, 
&ctr TSRMLS_CC);
@@ -1257,7 +1259,7 @@
 
                if (PG(output_handler) && PG(output_handler)[0]) {
                        zval *oh;
-                       
+
                        MAKE_STD_ZVAL(oh);
                        ZVAL_ASCII_STRING(oh, PG(output_handler), 
ZSTR_DUPLICATE);
                        php_output_start_user(oh, 0, 
PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
@@ -1450,6 +1452,16 @@
                }
        } zend_end_try();
 
+       /* 6.5 free last error information */
+       if (PG(last_error_message)) {
+               free(PG(last_error_message));
+               PG(last_error_message) = NULL;
+       }
+       if (PG(last_error_file)) {
+               free(PG(last_error_file));
+               PG(last_error_file) = NULL;
+       }
+
        /* 7. Shutdown scanner/executor/compiler and restore ini entries */
        zend_deactivate(TSRMLS_C);
 
@@ -1922,7 +1934,7 @@
 #ifndef ZTS
        core_globals_dtor(&core_globals TSRMLS_CC);
 #else
-       ts_free_id(core_globals_id);    
+       ts_free_id(core_globals_id);
 #endif
 
 #if defined(PHP_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1400)
@@ -1980,8 +1992,9 @@
                 *   otherwise it will get opened and added to the 
included_files list in zend_execute_scripts
                 */
                if (primary_file->filename &&
-                   primary_file->opened_path == NULL &&
-                   primary_file->type != ZEND_HANDLE_FILENAME) {
+                       primary_file->opened_path == NULL &&
+                       primary_file->type != ZEND_HANDLE_FILENAME
+               ) {
                        int realfile_len;
                        int dummy = 1;
                        if (VCWD_REALPATH(primary_file->filename, realfile)) {

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

Reply via email to