summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/wsyslog.c11
1 files changed, 8 insertions, 3 deletions
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