aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-17 13:03:21 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-17 13:04:10 +0000
commit2acb3cef220876eb6bcc11c8463998b36bc13b2b (patch)
tree7f42f857d24e3790991cf6d4e30cb3feedc0f1e5 /src/libstat/stat_config.c
parentacf64b4ac3773544743bf6773f43a26776ceafd5 (diff)
downloadrspamd-2acb3cef220876eb6bcc11c8463998b36bc13b2b.tar.gz
rspamd-2acb3cef220876eb6bcc11c8463998b36bc13b2b.zip
[Minor] Do not assert on non-initialized classifiers
Diffstat (limited to 'src/libstat/stat_config.c')
-rw-r--r--src/libstat/stat_config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c
index 8a953f47b..46e5dab31 100644
--- a/src/libstat/stat_config.c
+++ b/src/libstat/stat_config.c
@@ -173,8 +173,13 @@ rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base)
cl->ctx = stat_ctx;
cl->statfiles_ids = g_array_new (FALSE, FALSE, sizeof (gint));
cl->subrs = rspamd_stat_get_classifier (clf->classifier);
- g_assert (cl->subrs != NULL);
+ if (cl->subrs == NULL) {
+ g_slice_free1 (sizeof (*cl), cl);
+ msg_err_config ("cannot init classifier type %s", clf->name);
+ cur = g_list_next (cur);
+ continue;
+ }
if (!cl->subrs->init_func (cfg->cfg_pool, cl)) {
g_slice_free1 (sizeof (*cl), cl);