diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-14 13:41:39 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-14 13:42:48 +0000 |
commit | 4458d00f408a1369edaad97efa89fc99ece9c770 (patch) | |
tree | 017c9a7efeaa3bb5ae14cfc0af0d36df5ec8b4c8 /src | |
parent | 2a9268f256233fc184a76083a284060391234214 (diff) | |
download | rspamd-4458d00f408a1369edaad97efa89fc99ece9c770.tar.gz rspamd-4458d00f408a1369edaad97efa89fc99ece9c770.zip |
[Minor] Do not free string explicitly to allow new parser to work
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/message.c | 2 | ||||
-rw-r--r-- | src/libserver/task.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index e8b8f0bab..b259fdb0c 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -914,6 +914,7 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data) rspamd_mime_headers_process (task, mime_part->raw_headers, hdrs, strlen (hdrs), FALSE); mime_part->raw_headers_str = hdrs; + rspamd_mempool_add_destructor (task->task_pool, g_free, hdrs); } mime_part->type = type; @@ -983,6 +984,7 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data) rspamd_mime_headers_process (task, mime_part->raw_headers, hdrs, strlen (hdrs), FALSE); mime_part->raw_headers_str = hdrs; + rspamd_mempool_add_destructor (task->task_pool, g_free, hdrs); } mime_part->type = type; diff --git a/src/libserver/task.c b/src/libserver/task.c index 5ef1fedb6..bcf66aee8 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -199,10 +199,9 @@ rspamd_task_free (struct rspamd_task *task) for (i = 0; i < task->parts->len; i ++) { p = g_ptr_array_index (task->parts, i); - g_byte_array_free (p->content, TRUE); - if (p->raw_headers_str) { - g_free (p->raw_headers_str); + if (p->content) { + g_byte_array_free (p->content, TRUE); } if (p->raw_headers) { |