Skip to content

Commit

Permalink
Fix issue if rspamd cannot create statfiles.
Browse files Browse the repository at this point in the history
Issue:	#331
  • Loading branch information
vstakhov committed Jul 8, 2015
1 parent d32a7cf commit bad794e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libstat/stat_process.c
Expand Up @@ -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;
Expand Down

0 comments on commit bad794e

Please sign in to comment.