]> source.dussan.org Git - rspamd.git/commitdiff
Fix inserting to the hash.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Oct 2014 21:18:37 +0000 (22:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Oct 2014 21:18:37 +0000 (22:18 +0100)
src/libserver/symbols_cache.c

index f40847bd37fca60c47d59a89aa52de5e2f036745..a50462a0c0e01ab1594628b1a1e49c44a27fd514 100644 (file)
@@ -378,8 +378,12 @@ register_symbol_common (struct symbols_cache **cache,
                                skipped = FALSE;
 
                                item->s->weight = weight * (m->unknown_weight);
+                               s = rspamd_mempool_alloc0 (pcache->static_pool,
+                                               sizeof (*s));
+                               s->name = item->s->symbol;
+                               s->weight_ptr = &item->s->weight;
                                g_hash_table_insert (m->symbols, item->s->symbol,
-                                               &item->s->weight);
+                                               s);
                                mlist = g_hash_table_lookup (pcache->cfg->metrics_symbols, name);
                                mlist = g_list_prepend (mlist, m);
                                g_hash_table_insert (pcache->cfg->metrics_symbols,