]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix userdata storage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Feb 2019 15:36:57 +0000 (15:36 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Feb 2019 15:36:57 +0000 (15:36 +0000)
src/libserver/rspamd_symcache.c
src/lua/lua_config.c

index 615c7cdf61da3513a077c440e357c7cc663c75bc..3cfb15408128d0dd2d6c1906baf784e701ecdfb5 100644 (file)
@@ -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;
index a41ffa63faf805c2526cf798bdde9ebdd32c46b6..147e4ff804ca1135cf2241e65ec98d18bb277aab 100644 (file)
@@ -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;