From: Vsevolod Stakhov Date: Wed, 15 Apr 2009 12:44:37 +0000 (+0400) Subject: * Fix allocating and freeing of byte array X-Git-Tag: 0.2.7~196 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=086e9da19d8ceaa605b1151c93b229a2e1040e79;p=rspamd.git * Fix allocating and freeing of byte array --- diff --git a/src/message.c b/src/message.c index 0d4844141..32d9bd673 100644 --- a/src/message.c +++ b/src/message.c @@ -259,10 +259,10 @@ convert_text_to_utf (struct worker_task *task, GByteArray *part_content, GMimeCo return part_content; } - result_array = g_malloc (sizeof (GByteArray)); + result_array = memory_pool_alloc (task->task_pool, sizeof (GByteArray)); result_array->data = res_str; result_array->len = write_bytes + 1; - memory_pool_add_destructor (task->task_pool, (pool_destruct_func)free_byte_array_callback, result_array); + memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_free, res_str); return result_array; }