From 68885b28dc64f7b111c22548e600956fbb62ddea Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 29 Jan 2007 19:38:21 +0000 Subject: [PATCH] Prevent flush() of closed handle on php_module_shutdown() --- sapi/cgi/cgi_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 7b350810a6..e3b10b6710 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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; } -- 2.50.1