diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:23:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 10:44:51 +0100 |
commit | 6e467d152108d6eb84a4dd63f689995c73443268 (patch) | |
tree | 21f570a83ec6d72d204420dcfb436d93f2e0fd68 /src/libserver/milter.c | |
parent | 063d7483312f20db5d2a07ed791d9d5ee40de5e3 (diff) | |
download | rspamd-6e467d152108d6eb84a4dd63f689995c73443268.tar.gz rspamd-6e467d152108d6eb84a4dd63f689995c73443268.zip |
[Fix] Fix pools management for milter session
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r-- | src/libserver/milter.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c index e7a00b8e6..ca8589185 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -188,6 +188,7 @@ rspamd_milter_session_dtor (struct rspamd_milter_session *session) g_hash_table_destroy (priv->headers); } + rspamd_mempool_delete (priv->pool); g_free (priv); g_free (session); } @@ -1010,7 +1011,13 @@ rspamd_milter_handle_socket (gint fd, const struct timeval *tv, priv->parser.buf = rspamd_fstring_sized_new (RSPAMD_MILTER_MESSAGE_CHUNK + 5); priv->ev_base = ev_base; priv->state = RSPAMD_MILTER_READ_MORE; - priv->pool = pool; + priv->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), "milter"); + + if (pool) { + /* Copy tag */ + memcpy (priv->pool->tag.uid, pool->tag.uid, sizeof (pool->tag.uid)); + } + priv->headers = g_hash_table_new_full (rspamd_strcase_hash, rspamd_strcase_equal, g_free, NULL); |