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

index 67f1eedbbd968e3f05dfad791f470af3b676f39f..30da49a2e086b31ae31527b8fbfc08c515ce5fc9 100644 (file)
@@ -705,7 +705,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, "php6", NULL, NULL, "%s", message);
+       }
 }
 
 static time_t sapi_nsapi_get_request_time(TSRMLS_D)