aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-17 16:53:20 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-17 16:53:20 +0000
commit6ff5a8debb423d1c7b62f18833cdd500876848af (patch)
tree25e76b93869c9c844aacda9c7ba34e0f8eab299d /src/plugins/spf.c
parent5dd52de750ce5dfbbe182d204d0a66498bc69a9a (diff)
downloadrspamd-6ff5a8debb423d1c7b62f18833cdd500876848af.tar.gz
rspamd-6ff5a8debb423d1c7b62f18833cdd500876848af.zip
[Fix] Fix memory leak on reload in plugins
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index e51016429..15ebdab31 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -83,9 +83,11 @@ module_t spf_module = {
gint
spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
- spf_module_ctx = g_malloc (sizeof (struct spf_ctx));
+ if (spf_module_ctx == NULL) {
+ spf_module_ctx = g_malloc (sizeof (struct spf_ctx));
- spf_module_ctx->spf_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
+ spf_module_ctx->spf_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
+ }
*ctx = (struct module_ctx *)spf_module_ctx;