aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/email_addr.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/email_addr.c
parentaf417271a47e88d47cc3dc25f93f56d74864c3dd (diff)
downloadrspamd-24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2.tar.gz
rspamd-24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2.zip
[Project] Track more memory allocations in a task
Diffstat (limited to 'src/libmime/email_addr.c')
-rw-r--r--src/libmime/email_addr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libmime/email_addr.c b/src/libmime/email_addr.c
index 24b1d0111..4e09de6fb 100644
--- a/src/libmime/email_addr.c
+++ b/src/libmime/email_addr.c
@@ -110,6 +110,7 @@ rspamd_email_address_add (rspamd_mempool_t *pool,
guint nlen;
elt = g_malloc0 (sizeof (*elt));
+ rspamd_mempool_notify_alloc (pool, sizeof (*elt));
if (addr != NULL) {
memcpy (elt, addr, sizeof (*addr));
@@ -132,6 +133,7 @@ rspamd_email_address_add (rspamd_mempool_t *pool,
/* We need to unquote addr */
nlen = elt->domain_len + elt->user_len + 2;
elt->addr = g_malloc (nlen + 1);
+ rspamd_mempool_notify_alloc (pool, nlen + 1);
elt->addr_len = rspamd_snprintf ((char *)elt->addr, nlen, "%*s@%*s",
(gint)elt->user_len, elt->user,
(gint)elt->domain_len, elt->domain);
@@ -143,6 +145,7 @@ rspamd_email_address_add (rspamd_mempool_t *pool,
elt->name = rspamd_mime_header_decode (pool, name->str, name->len, NULL);
}
+ rspamd_mempool_notify_alloc (pool, name->len);
g_ptr_array_add (ar, elt);
}
@@ -481,6 +484,7 @@ rspamd_email_address_from_mime (rspamd_mempool_t *pool,
break;
}
+ rspamd_mempool_notify_alloc (pool, cpy->len);
g_string_free (ns, TRUE);
return res;