diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-10 22:59:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-10 23:10:23 +0000 |
commit | a75b186bfabe99a2782cda903fd35b9eae6cd665 (patch) | |
tree | 370125238391430b42496f7033e6dc9f8d9d2a64 | |
parent | 487588eb24a79e284a139174bc1b88bd8af4d67e (diff) | |
download | rspamd-a75b186bfabe99a2782cda903fd35b9eae6cd665.tar.gz rspamd-a75b186bfabe99a2782cda903fd35b9eae6cd665.zip |
Fix issues found by coverity
-rw-r--r-- | src/libmime/mime_expressions.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index 6a422e82e..ba2045ee4 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -678,10 +678,8 @@ set: return a; err: - if (mime_atom != NULL) { - g_free (mime_atom->str); - g_slice_free1 (sizeof (*mime_atom), mime_atom); - } + g_free (mime_atom->str); + g_slice_free1 (sizeof (*mime_atom), mime_atom); return NULL; } @@ -1348,12 +1346,16 @@ rspamd_has_html_tag (struct rspamd_task * task, GArray * args, void *unused) return FALSE; } - for (i = 0; i < task->text_parts->len && res; i ++) { + for (i = 0; i < task->text_parts->len; i ++) { p = g_ptr_array_index (task->text_parts, i); if (!IS_PART_EMPTY (p) && IS_PART_HTML (p) && p->html) { res = rspamd_html_tag_seen (p->html, arg->data); } + + if (res) { + break; + } } return res; @@ -1849,6 +1851,8 @@ common_has_content_part (struct rspamd_task * task, if (r && param_subtype) { r = compare_len (part, min_len, max_len) && compare_subtype (task, ct, param_subtype); + + return r; } } else { |