diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-25 15:18:47 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-25 15:18:47 +0000 |
commit | 0599cdf4bbc8a38d159cff27195c71e27fb21000 (patch) | |
tree | 56c071c1f0a1d6b751c1be59c68bf89b673e320d | |
parent | e0b4ba6307bcb324e380b4420f1a49bcc1ef764f (diff) | |
download | rspamd-0599cdf4bbc8a38d159cff27195c71e27fb21000.tar.gz rspamd-0599cdf4bbc8a38d159cff27195c71e27fb21000.zip |
Clean log buffer when forking
-rw-r--r-- | src/libutil/logger.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 5f5d062d3..2c7ceeef7 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -386,6 +386,21 @@ rspamd_log_update_pid (GQuark ptype, rspamd_logger_t *rspamd_log) { rspamd_log->pid = getpid (); rspamd_log->process_type = ptype; + + /* We also need to clear all messages pending */ + if (rspamd_log->repeats > 0) { + rspamd_log->repeats = 0; + if (rspamd_log->saved_message) { + g_free (rspamd_log->saved_message); + g_free (rspamd_log->saved_function); + g_free (rspamd_log->saved_module); + g_free (rspamd_log->saved_id); + rspamd_log->saved_message = NULL; + rspamd_log->saved_function = NULL; + rspamd_log->saved_module = NULL; + rspamd_log->saved_id = NULL; + } + } } /** |