diff options
Diffstat (limited to 'src/libserver/logger/logger_file.c')
-rw-r--r-- | src/libserver/logger/logger_file.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libserver/logger/logger_file.c b/src/libserver/logger/logger_file.c index 490cf0b65..20b04b852 100644 --- a/src/libserver/logger/logger_file.c +++ b/src/libserver/logger/logger_file.c @@ -465,13 +465,15 @@ bool rspamd_log_file_log(const gchar *module, const gchar *id, now = rspamd_get_calendar_ticks(); } - gsize niov = rspamd_log_fill_iov(NULL, now, module, id, function, level_flags, message, - mlen, rspamd_log); - struct iovec *iov = g_alloca(sizeof(struct iovec) * niov); - rspamd_log_fill_iov(iov, now, module, id, function, level_flags, message, + struct rspamd_logger_iov_ctx iov_ctx; + memset(&iov_ctx, 0, sizeof(iov_ctx)); + rspamd_log_fill_iov(&iov_ctx, now, module, id, function, level_flags, message, mlen, rspamd_log); - return file_log_helper(rspamd_log, priv, iov, niov, level_flags); + bool ret = file_log_helper(rspamd_log, priv, iov_ctx.iov, iov_ctx.niov, level_flags); + rspamd_log_iov_free(&iov_ctx); + + return ret; } void * |