aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_parser.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-23 19:27:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-23 19:27:04 +0000
commit24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2 (patch)
tree1fe6d34eb2060f4ba3f645064e16b8f24a6683ff /src/libmime/mime_parser.c
parentaf417271a47e88d47cc3dc25f93f56d74864c3dd (diff)
downloadrspamd-24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2.tar.gz
rspamd-24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2.zip
[Project] Track more memory allocations in a task
Diffstat (limited to 'src/libmime/mime_parser.c')
-rw-r--r--src/libmime/mime_parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index 18c54d13b..d989a8e2e 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -539,6 +539,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
memcpy (parsed->str, part->raw_data.begin, parsed->len);
part->parsed_data.begin = parsed->str;
part->parsed_data.len = parsed->len;
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_fstring_free, parsed);
}
@@ -555,6 +556,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
parsed->len = r;
part->parsed_data.begin = parsed->str;
part->parsed_data.len = parsed->len;
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_fstring_free, parsed);
}
@@ -566,6 +568,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
parsed->len = part->raw_data.len;
part->parsed_data.begin = parsed->str;
part->parsed_data.len = parsed->len;
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_fstring_free, parsed);
}
@@ -577,6 +580,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
parsed->str, &parsed->len);
part->parsed_data.begin = parsed->str;
part->parsed_data.len = parsed->len;
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_fstring_free, parsed);
break;
@@ -584,6 +588,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
parsed = rspamd_fstring_sized_new (part->raw_data.len / 4 * 3 + 12);
r = rspamd_decode_uue_buf (part->raw_data.begin, part->raw_data.len,
parsed->str, parsed->allocated);
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_fstring_free, parsed);
if (r != -1) {
@@ -597,6 +602,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
part->cte = RSPAMD_CTE_8BIT;
parsed->len = MIN (part->raw_data.len, parsed->allocated);
memcpy (parsed->str, part->raw_data.begin, parsed->len);
+ rspamd_mempool_notify_alloc (task->task_pool, parsed->len);
part->parsed_data.begin = parsed->str;
part->parsed_data.len = parsed->len;
}