diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-18 23:36:42 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-18 23:36:42 +0000 |
commit | 20457a019f6940fbb6e6a5e89ab23f42b126ad3b (patch) | |
tree | f35c0e725a830b6242ef4b9f2624ad65875d5aa9 /src/libutil/expression.c | |
parent | 6950e3a46bace0e026d0a0df67f931ca459ac0a7 (diff) | |
download | rspamd-20457a019f6940fbb6e6a5e89ab23f42b126ad3b.tar.gz rspamd-20457a019f6940fbb6e6a5e89ab23f42b126ad3b.zip |
[Fix] Fix memory corruprtion and leak
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index adc926e53..a7cc1af80 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -567,6 +567,7 @@ rspamd_parse_expression (const gchar *line, gsize len, enum rspamd_expression_op op, op_stack; const gchar *p, *c, *end; GPtrArray *operand_stack; + GNode *tmp; enum { PARSE_ATOM = 0, @@ -859,6 +860,10 @@ rspamd_parse_expression (const gchar *line, gsize len, return TRUE; err: + while ((tmp = rspamd_expr_stack_elt_pop (operand_stack)) != NULL) { + g_node_destroy (tmp); + } + g_ptr_array_free (operand_stack, TRUE); rspamd_expression_destroy (e); |