aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 87b2dd0fa..1e13f6a56 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -1480,14 +1480,6 @@ rspamd_rcl_composite_handler (rspamd_mempool_t *pool,
rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (struct rspamd_composite));
composite->expr = expr;
composite->id = g_hash_table_size (cfg->composite_symbols);
- g_hash_table_insert (cfg->composite_symbols,
- (gpointer)composite_name,
- composite);
-
- if (new) {
- rspamd_symbols_cache_add_symbol (cfg->cache, composite_name, 0,
- NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
- }
val = ucl_object_lookup (obj, "score");
if (val != NULL && ucl_object_todouble_safe (val, &score)) {
@@ -1537,6 +1529,15 @@ rspamd_rcl_composite_handler (rspamd_mempool_t *pool,
}
}
+ g_hash_table_insert (cfg->composite_symbols,
+ (gpointer)composite_name,
+ composite);
+
+ if (new) {
+ rspamd_symbols_cache_add_symbol (cfg->cache, composite_name, 0,
+ NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
+ }
+
return TRUE;
}