aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/content_type.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-12 23:15:33 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-12 23:15:33 +0000
commitc10f4cf4169a8d0ad9709f8c7b6b187edc207b1f (patch)
tree1654f03124417ff267efdf920d1984e6bad6dd7a /src/libmime/content_type.c
parent59351eb72ce4ce607a3ae2762a0101650244eab9 (diff)
downloadrspamd-c10f4cf4169a8d0ad9709f8c7b6b187edc207b1f.tar.gz
rspamd-c10f4cf4169a8d0ad9709f8c7b6b187edc207b1f.zip
[Fix] Plug another possible memory leak
MFH: rspamd-1.6
Diffstat (limited to 'src/libmime/content_type.c')
-rw-r--r--src/libmime/content_type.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index f115bcb31..946a9b838 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -470,6 +470,8 @@ rspamd_content_disposition_add_param (rspamd_mempool_t *pool,
else {
cd->attrs = g_hash_table_new (rspamd_ftok_icase_hash,
rspamd_ftok_icase_equal);
+ rspamd_mempool_add_destructor (pool,
+ (rspamd_mempool_destruct_t)g_hash_table_unref, cd->attrs);
}
nparam = rspamd_mempool_alloc (pool, sizeof (*nparam));
@@ -507,11 +509,6 @@ rspamd_content_disposition_parse (const gchar *in,
if (rspamd_content_disposition_parser (in, len, &val, pool)) {
res = rspamd_mempool_alloc (pool, sizeof (val));
memcpy (res, &val, sizeof (val));
-
- if (res->attrs) {
- rspamd_mempool_add_destructor (pool,
- (rspamd_mempool_destruct_t)g_hash_table_unref, res->attrs);
- }
}
else {
msg_warn_pool ("cannot parse content disposition: %*s",