Skip to content

Commit 6115e49

Browse files
committed
Fixed first-chance exception during request shutdown
1 parent 12f2e71 commit 6115e49

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

win32/wsyslog.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@
6161
void closelog(void)
6262
{
6363
TSRMLS_FETCH();
64-
DeregisterEventSource(PW32G(log_source));
65-
STR_FREE(PW32G(log_header));
66-
PW32G(log_header) = NULL;
64+
if (PW32G(log_source)) {
65+
DeregisterEventSource(PW32G(log_source));
66+
PW32G(log_source) = NULL;
67+
}
68+
if (PW32G(log_header)) {
69+
STR_FREE(PW32G(log_header));
70+
PW32G(log_header) = NULL;
71+
}
6772
}
6873

6974
/* Emulator for BSD syslog() routine

0 commit comments

Comments
 (0)