aboutsummaryrefslogtreecommitdiffstats
path: root/src/message.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/message.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/message.c')
-rw-r--r--src/message.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/message.c b/src/message.c
index f2add5b47..33cf04732 100644
--- a/src/message.c
+++ b/src/message.c
@@ -397,6 +397,15 @@ mime_foreach_callback (GMimeObject *part, gpointer user_data)
}
}
+static void
+destroy_message (void *pointer)
+{
+ GMimeMessage *msg = pointer;
+
+ msg_debug ("destroy_message: freeing pointer %p", msg);
+ g_object_unref (msg);
+}
+
int
process_message (struct worker_task *task)
{
@@ -429,7 +438,7 @@ process_message (struct worker_task *task)
}
task->message = message;
- memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_object_unref, task->message);
+ memory_pool_add_destructor (task->task_pool, (pool_destruct_func)destroy_message, task->message);
#ifdef GMIME24
g_mime_message_foreach (message, mime_foreach_callback, task);