diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-19 18:14:23 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-19 18:14:23 +0000 |
commit | 3a344136cc275fa2e0879d10e6ef119e882b58c9 (patch) | |
tree | f87fe6edb7f619bc058dc5692cc041fe9bacadec /src/libmime/mime_expressions.c | |
parent | a0b33ff3bab1fa9ef2a24008d63eaeb9b35d79ee (diff) | |
download | rspamd-3a344136cc275fa2e0879d10e6ef119e882b58c9.tar.gz rspamd-3a344136cc275fa2e0879d10e6ef119e882b58c9.zip |
Add code to destroy mime atom.
Diffstat (limited to 'src/libmime/mime_expressions.c')
-rw-r--r-- | src/libmime/mime_expressions.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index bbe411f01..acc2caf0a 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -588,13 +588,33 @@ rspamd_mime_expr_process (gpointer input, rspamd_expression_atom_t *atom) static gint rspamd_mime_expr_priority (rspamd_expression_atom_t *atom) { - + /* TODO: implement priorities for mime expressions */ + return 0; } static void rspamd_mime_expr_destroy (rspamd_expression_atom_t *atom) { + struct rspamd_mime_atom *mime_atom = atom->data; + guint i; + struct expression_argument *arg; + if (mime_atom) { + if (mime_atom->is_function) { + /* Need to cleanup arguments */ + for (i = 0; i < mime_atom->d.func->args->len; i ++) { + arg = &g_array_index (mime_atom->d.func->args, + struct expression_argument, i); + + if (arg->type == EXPRESSION_ARGUMENT_NORMAL) { + g_free (arg->data); + } + } + g_array_free (mime_atom->d.func->args, TRUE); + } + /* XXX: regexp shouldn't be special */ + g_slice_free1 (sizeof (*mime_atom), mime_atom); + } } gboolean |