From 219e642ffd46aac0ae905ef682df16eab9b6e93b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 12 Sep 2018 13:01:03 +0100 Subject: [PATCH] [Fix] Do not allow events deletions on cleanup --- src/libserver/events.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libserver/events.c b/src/libserver/events.c index a15338e7a7..9fa2c69c1d 100644 --- a/src/libserver/events.c +++ b/src/libserver/events.c @@ -238,6 +238,11 @@ rspamd_session_remove_event (struct rspamd_async_session *session, return; } + if (!RSPAMD_SESSION_CAN_ADD_EVENT (session)) { + /* Session is already cleaned up, ignore this */ + return; + } + /* Search for event */ search_ev.fin = fin; search_ev.user_data = ud; -- 2.47.3