diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-10 22:18:37 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-10 22:18:37 +0100 |
commit | 347a46329722cb05d2b968e749773a1d0c2594ca (patch) | |
tree | faa44d5987ef50208a27772868e2d0cce8eefc5b | |
parent | fe4a447263c6a990a3d044ecc99def866babe35c (diff) | |
download | rspamd-347a46329722cb05d2b968e749773a1d0c2594ca.tar.gz rspamd-347a46329722cb05d2b968e749773a1d0c2594ca.zip |
Fix inserting to the hash.
-rw-r--r-- | src/libserver/symbols_cache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index f40847bd3..a50462a0c 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -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, |