From 2605683a36d33d8c1475e266c31ef92f8c9d6046 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 20 Mar 2009 15:53:34 +0000 Subject: [PATCH] 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 !!! --- sapi/nsapi/nsapi.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- 2.40.0