From: Vsevolod Stakhov Date: Thu, 21 Feb 2019 15:36:57 +0000 (+0000) Subject: [Minor] Fix userdata storage X-Git-Tag: 1.9.0~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=72d9ed6d599a41f430fde499ade11ae755a08540;p=rspamd.git [Minor] Fix userdata storage --- 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;