]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not assert on non-initialized classifiers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Nov 2016 13:03:21 +0000 (13:03 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Nov 2016 13:04:10 +0000 (13:04 +0000)
src/libstat/stat_config.c

index 8a953f47bc57d830fd46a86ec23605d3348eb6e4..46e5dab31e424036d609175e25d70efcebb50312 100644 (file)
@@ -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);