From 2acb3cef220876eb6bcc11c8463998b36bc13b2b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Nov 2016 13:03:21 +0000 Subject: [Minor] Do not assert on non-initialized classifiers --- src/libstat/stat_config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3