From: Vsevolod Stakhov Date: Wed, 1 Feb 2017 13:13:40 +0000 (+0000) Subject: [Minor] Avoid double session cleanup X-Git-Tag: 1.5.0~201 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3a58c2c32ff44781e0401d9c94906f41a8272ad3;p=rspamd.git [Minor] Avoid double session cleanup --- diff --git a/src/libserver/events.c b/src/libserver/events.c index 44a5d9191..2c8f9999c 100644 --- a/src/libserver/events.c +++ b/src/libserver/events.c @@ -217,11 +217,13 @@ rspamd_session_destroy (struct rspamd_async_session *session) return FALSE; } - session->flags |= RSPAMD_SESSION_FLAG_DESTROYING; - rspamd_session_cleanup (session); + if (!(session->flags & RSPAMD_SESSION_FLAG_DESTROYING)) { + session->flags |= RSPAMD_SESSION_FLAG_DESTROYING; + rspamd_session_cleanup (session); - if (session->cleanup != NULL) { - session->cleanup (session->user_data); + if (session->cleanup != NULL) { + session->cleanup (session->user_data); + } } return TRUE;