diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-05-08 16:07:35 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-05-08 16:07:35 +0400 |
commit | afe65479c0052b38e080d7d9adaeba7326823dea (patch) | |
tree | bb77b1c0e6eb3d0ca2460761f0da1a203c385396 /src/message.c | |
parent | 6de65fd30e9f2c924f5c73281c7bea1679fb18fa (diff) | |
download | rspamd-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.c | 11 |
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); |