From: Vsevolod Stakhov Date: Wed, 25 Nov 2015 15:18:47 +0000 (+0000) Subject: Clean log buffer when forking X-Git-Tag: 1.1.0~481 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0599cdf4bbc8a38d159cff27195c71e27fb21000;p=rspamd.git Clean log buffer when forking --- 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; + } + } } /**