aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/logger
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-21 12:27:10 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-21 12:27:10 +0100
commit384e037f52b933fdd3cb84966208f8e658212ffe (patch)
tree6d30a350091cff48629d8cbb4672b66fb7183f29 /src/libserver/logger
parentb31bf8d584d323648603860486056f4ff6dc7af3 (diff)
downloadrspamd-384e037f52b933fdd3cb84966208f8e658212ffe.tar.gz
rspamd-384e037f52b933fdd3cb84966208f8e658212ffe.zip
[Minor] Fix some more issues
Found by: coverity scan
Diffstat (limited to 'src/libserver/logger')
-rw-r--r--src/libserver/logger/logger.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/libserver/logger/logger.c b/src/libserver/logger/logger.c
index f65d0fb2e..07625bb91 100644
--- a/src/libserver/logger/logger.c
+++ b/src/libserver/logger/logger.c
@@ -227,16 +227,21 @@ rspamd_log_open_specific (rspamd_mempool_t *pool,
const struct rspamd_logger_funcs *funcs = NULL;
- switch (cfg->log_type) {
- case RSPAMD_LOG_CONSOLE:
+ if (cfg) {
+ switch (cfg->log_type) {
+ case RSPAMD_LOG_CONSOLE:
+ funcs = &console_log_funcs;
+ break;
+ case RSPAMD_LOG_SYSLOG:
+ funcs = &syslog_log_funcs;
+ break;
+ case RSPAMD_LOG_FILE:
+ funcs = &file_log_funcs;
+ break;
+ }
+ }
+ else {
funcs = &console_log_funcs;
- break;
- case RSPAMD_LOG_SYSLOG:
- funcs = &syslog_log_funcs;
- break;
- case RSPAMD_LOG_FILE:
- funcs = &file_log_funcs;
- break;
}
g_assert (funcs != NULL);