From 72d9ed6d599a41f430fde499ade11ae755a08540 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 Feb 2019 15:36:57 +0000 Subject: [PATCH] [Minor] Fix userdata storage --- src/libserver/rspamd_symcache.c | 2 ++ src/lua/lua_config.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c index 615c7cdf6..3cfb15408 100644 --- a/src/libserver/rspamd_symcache.c +++ b/src/libserver/rspamd_symcache.c @@ -931,6 +931,8 @@ rspamd_symcache_add_symbol (struct rspamd_symcache *cache, */ if (item->type & SYMBOL_TYPE_COMPOSITE) { item->specific.normal.condition_cb = -1; + item->specific.normal.user_data = user_data; + g_assert (user_data != NULL); g_ptr_array_add (cache->composites, item); item->id = cache->items_by_id->len; diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index a41ffa63f..147e4ff80 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -2431,7 +2431,7 @@ lua_config_add_composite (lua_State * L) if (new) { rspamd_symcache_add_symbol (cfg->cache, name, - 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1); + 0, NULL, composite, SYMBOL_TYPE_COMPOSITE, -1); } ret = TRUE; -- 2.39.5