]> granicus.if.org Git - php/commitdiff
Prevent flush() of closed handle on php_module_shutdown()
authorDmitry Stogov <dmitry@php.net>
Mon, 29 Jan 2007 19:38:21 +0000 (19:38 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 29 Jan 2007 19:38:21 +0000 (19:38 +0000)
sapi/cgi/cgi_main.c

index 7b350810a614ad68566e2d6764cdd156f727dd30..e3b10b671014e0b03bae66a4b51a5523de00dd8d 100644 (file)
@@ -1451,6 +1451,7 @@ consult the installation file that came with this distribution, or visit \n\
 
                                                case 'i': /* php info & quit */
                                                        if (php_request_startup(TSRMLS_C) == FAILURE) {
+                                                               SG(server_context) = NULL;
                                                                php_module_shutdown(TSRMLS_C);
                                                                return FAILURE;
                                                        }
@@ -1497,6 +1498,7 @@ consult the installation file that came with this distribution, or visit \n\
                                                case 'v': /* show php version & quit */
                                                        no_headers = 1;
                                                        if (php_request_startup(TSRMLS_C) == FAILURE) {
+                                                               SG(server_context) = NULL;
                                                                php_module_shutdown(TSRMLS_C);
                                                                return FAILURE;
                                                        }
@@ -1597,6 +1599,7 @@ consult the installation file that came with this distribution, or visit \n\
                                if (fastcgi) {
                                        fcgi_finish_request(&request);
                                }
+                               SG(server_context) = NULL;
                                php_module_shutdown(TSRMLS_C);
                                return FAILURE;
                        }
@@ -1627,6 +1630,7 @@ consult the installation file that came with this distribution, or visit \n\
                                        goto fastcgi_request_done;
                                }
                                php_request_shutdown((void *) 0);
+                               SG(server_context) = NULL;
                                php_module_shutdown(TSRMLS_C);
                                return FAILURE;
                        }