]> source.dussan.org Git - rspamd.git/commitdiff
* Fix allocating and freeing of byte array
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 15 Apr 2009 12:44:37 +0000 (16:44 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 15 Apr 2009 12:44:37 +0000 (16:44 +0400)
src/message.c

index 0d48441414d10d1c6fb305a937e63e82eeeca54e..32d9bd6731746d01d7f7f22fef7aa19fd1c3036f 100644 (file)
@@ -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;
 }