]> granicus.if.org Git - php/commitdiff
MFH: Fix crash on server startup when log message is printed
authorUwe Schindler <thetaphi@php.net>
Fri, 27 Apr 2007 00:29:26 +0000 (00:29 +0000)
committerUwe Schindler <thetaphi@php.net>
Fri, 27 Apr 2007 00:29:26 +0000 (00:29 +0000)
sapi/nsapi/nsapi.c

index fcd38f023e00ce43f243833a06eaa17ec654ad09..dac56dd711563b44c61d6e2da9ecb1c651558238 100644 (file)
@@ -709,7 +709,11 @@ static void nsapi_log_message(char *message)
        TSRMLS_FETCH();
        nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
 
-       log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message);
+       if (rc) {
+               log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message);
+       } else {
+               log_error(LOG_INFORM, "php5", NULL, NULL, "%s", message);
+       }
 }
 
 static time_t sapi_nsapi_get_request_time(TSRMLS_D)