From abac73e5d24c9b1c79ccb179aac069df0e1d4ede Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 26 Oct 2015 22:22:09 +0000 Subject: [PATCH] Avoid use-after-free. --- src/controller.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controller.c b/src/controller.c index dde2944f5..55f1a3bd5 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2021,16 +2021,18 @@ rspamd_controller_finish_handler (struct rspamd_http_connection_entry *conn_ent) struct rspamd_controller_session *session = conn_ent->ud; session->ctx->worker->srv->stat->control_connections_count++; + msg_debug_session ("destroy session %p", session); + if (session->task != NULL) { rspamd_session_destroy (session->task->s); } + if (session->pool) { rspamd_mempool_delete (session->pool); } session->wrk->nconns --; rspamd_inet_address_destroy (session->from_addr); - msg_debug_session ("destroy session %p", session); g_slice_free1 (sizeof (struct rspamd_controller_session), session); } -- 2.39.5