aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-13 10:58:02 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-13 10:58:02 +0100
commite26f428b72de0762a5dc6421941f9e59dba3be01 (patch)
tree4cd7173fb1453724752c540c8d90f6179ed07ce9
parenta7e832b5dd9f11bb81ebbf593fa1ea786a5b5aa1 (diff)
downloadrspamd-e26f428b72de0762a5dc6421941f9e59dba3be01.tar.gz
rspamd-e26f428b72de0762a5dc6421941f9e59dba3be01.zip
Fix symbols removal in composites.
-rw-r--r--src/libmime/filter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index b294abc36..70e5c3c6b 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -572,11 +572,9 @@ rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom)
* evaluated.
*/
if ((rd = g_tree_lookup (cd->symbols_to_remove, ms->name)) == NULL) {
- g_tree_insert (cd->symbols_to_remove,
- (gpointer)ms->name,
- rd);
rd = rspamd_mempool_alloc (cd->task->task_pool, sizeof (*rd));
rd->ms = ms;
+
if (G_UNLIKELY (t == '~')) {
rd->remove_weight = FALSE;
rd->remove_symbol = TRUE;
@@ -589,7 +587,11 @@ rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom)
rd->remove_symbol = TRUE;
rd->remove_weight = TRUE;
}
+
rd->comp = g_list_prepend (NULL, cd->composite);
+ g_tree_insert (cd->symbols_to_remove,
+ (gpointer)ms->name,
+ rd);
}
else {
/*