From: Uwe Schindler Date: Fri, 20 Mar 2009 15:53:34 +0000 (+0000) Subject: Fix a sigsegv on server shutdown, add missing sapi_shutdown(). X-Git-Tag: php-5.4.0alpha1~191^2~4085 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2605683a36d33d8c1475e266c31ef92f8c9d6046;p=php Fix a sigsegv on server shutdown, add missing sapi_shutdown(). !!! This should also be merged into 5.3, I prepared it, please tell me if it is ok to commit !!! --- diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 5ba67011a5..3d0a2f250e 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -466,6 +466,11 @@ static void sapi_nsapi_flush(void *server_context) { nsapi_request_context *rc = (nsapi_request_context *)server_context; TSRMLS_FETCH(); + + if (!rc) { + /* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */ + return; + } if (!SG(headers_sent)) { sapi_send_headers(TSRMLS_C); @@ -878,6 +883,7 @@ void NSAPI_PUBLIC php6_close(void *vparam) } #endif + sapi_shutdown(); tsrm_shutdown(); log_error(LOG_INFORM, "php6_close", NULL, NULL, "Shutdown PHP Module");