From: Dmitry Stogov Date: Mon, 16 Jan 2006 14:26:07 +0000 (+0000) Subject: Fixed first-chance exception during request shutdown X-Git-Tag: php-5.1.3RC1~252 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc410c3863eb4aba783ec2bfd1ccbc723589cf9c;p=php Fixed first-chance exception during request shutdown --- diff --git a/win32/wsyslog.c b/win32/wsyslog.c index 294b3976c4..4266079e13 100644 --- a/win32/wsyslog.c +++ b/win32/wsyslog.c @@ -62,9 +62,14 @@ void closelog(void) { TSRMLS_FETCH(); - DeregisterEventSource(PW32G(log_source)); - STR_FREE(PW32G(log_header)); - PW32G(log_header) = NULL; + if (PW32G(log_source)) { + DeregisterEventSource(PW32G(log_source)); + PW32G(log_source) = NULL; + } + if (PW32G(log_header)) { + STR_FREE(PW32G(log_header)); + PW32G(log_header) = NULL; + } } /* Emulator for BSD syslog() routine