diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 16:51:10 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 16:51:10 +0100 |
commit | bad794eba235a0c21ac7a6897e575ae5042944cc (patch) | |
tree | 4cbaf4a15568722a116535c131de8fccce50f3d1 /src | |
parent | d32a7cf4cab1003ab1dc9a953c181bb025fd15f1 (diff) | |
download | rspamd-bad794eba235a0c21ac7a6897e575ae5042944cc.tar.gz rspamd-bad794eba235a0c21ac7a6897e575ae5042944cc.zip |
Fix issue if rspamd cannot create statfiles.
Issue: #331
Diffstat (limited to 'src')
-rw-r--r-- | src/libstat/stat_process.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 93692a621..588beb972 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -219,6 +219,15 @@ rspamd_stat_preprocess (struct rspamd_stat_ctx *st_ctx, backend_runtime = bk->runtime (task, stcf, op != RSPAMD_CLASSIFY_OP, bk->ctx); + if (backend_runtime == NULL && op != RSPAMD_CLASSIFY_OP) { + /* Assume backend absence as fatal error */ + g_set_error (err, rspamd_stat_quark(), 500, + "cannot open backend for statfile %s", stcf->symbol); + g_list_free (cl_runtimes); + + return NULL; + } + st_runtime = rspamd_mempool_alloc0 (task->task_pool, sizeof (*st_runtime)); st_runtime->st = stcf; |