aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-08 16:07:35 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-08 16:07:35 +0400
commitafe65479c0052b38e080d7d9adaeba7326823dea (patch)
treebb77b1c0e6eb3d0ca2460761f0da1a203c385396 /src/expressions.c
parent6de65fd30e9f2c924f5c73281c7bea1679fb18fa (diff)
downloadrspamd-afe65479c0052b38e080d7d9adaeba7326823dea.tar.gz
rspamd-afe65479c0052b38e080d7d9adaeba7326823dea.zip
* Fix memory leak when ref'ing message mime part without unrefing it
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/expressions.c b/src/expressions.c
index c0c791907..c7b88adb9 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -1507,14 +1507,17 @@ rspamd_compare_transfer_encoding (struct worker_task *task, GList *args)
}
part = g_mime_message_get_mime_part (task->message);
- if (part && GMIME_IS_PART (part)) {
- part_enc = g_mime_part_get_encoding (GMIME_PART (part));
- g_object_unref (part);
+ if (part) {
+ if (GMIME_IS_PART (part)) {
+ part_enc = g_mime_part_get_encoding (GMIME_PART (part));
- msg_debug ("rspamd_compare_transfer_encoding: got encoding in part: %d and compare with %d",
- (int)part_enc, (int)enc_req);
+ msg_debug ("rspamd_compare_transfer_encoding: got encoding in part: %d and compare with %d",
+ (int)part_enc, (int)enc_req);
+ g_object_unref (part);
- return part_enc == enc_req;
+ return part_enc == enc_req;
+ }
+ g_object_unref (part);
}
return FALSE;