aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-06 20:07:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-06 20:07:28 +0100
commitc60a81d93b042890c86298dc6274a375dca3271a (patch)
tree35aeb473cfa8951ce981d3efa12830ab1e88f9c0
parent7179d09a634f1c8b605f5602f19a3fb8a5fb5976 (diff)
downloadrspamd-c60a81d93b042890c86298dc6274a375dca3271a.tar.gz
rspamd-c60a81d93b042890c86298dc6274a375dca3271a.zip
Fix mutex locking for logger.
-rw-r--r--src/libutil/logger.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index a340ea883..cdbbc0154 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -385,7 +385,7 @@ rspamd_common_logv (rspamd_logger_t *rspamd_log,
const gchar *fmt,
va_list args)
{
- static gchar logbuf[RSPAMD_LOGBUF_SIZE];
+ gchar logbuf[RSPAMD_LOGBUF_SIZE];
u_char *end;
if (rspamd_log == NULL) {
@@ -402,10 +402,10 @@ rspamd_common_logv (rspamd_logger_t *rspamd_log,
}
}
else if (log_level <= rspamd_log->cfg->log_level) {
- rspamd_mempool_lock_mutex (rspamd_log->mtx);
end = rspamd_vsnprintf (logbuf, sizeof (logbuf), fmt, args);
*end = '\0';
rspamd_escape_log_string (logbuf);
+ rspamd_mempool_lock_mutex (rspamd_log->mtx);
rspamd_log->log_func (NULL,
function,
log_level,