diff options
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controller.c b/src/controller.c index 2f76bcc69..474e7ec92 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3769,6 +3769,9 @@ start_controller_worker (struct rspamd_worker *worker) /* Accept event */ ctx->http_ctx = rspamd_http_context_create (ctx->cfg, ctx->event_loop, ctx->cfg->ups_ctx); + rspamd_mempool_add_destructor (ctx->cfg->cfg_pool, + (rspamd_mempool_destruct_t)rspamd_http_context_free, + ctx->http_ctx); ctx->http = rspamd_http_router_new (rspamd_controller_error_handler, rspamd_controller_finish_handler, ctx->timeout, ctx->static_files_dir, ctx->http_ctx); @@ -3942,9 +3945,7 @@ start_controller_worker (struct rspamd_worker *worker) g_hash_table_unref (ctx->plugins); g_hash_table_unref (ctx->custom_commands); - struct rspamd_http_context *http_ctx = ctx->http_ctx; REF_RELEASE (ctx->cfg); - rspamd_http_context_free (http_ctx); rspamd_log_close (worker->srv->logger, TRUE); exit (EXIT_SUCCESS); |