diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-01 13:13:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-01 13:13:40 +0000 |
commit | 3a58c2c32ff44781e0401d9c94906f41a8272ad3 (patch) | |
tree | 06be7a8fb7256783bc953082b999bb7dbd359f5d | |
parent | 41dc9d8afff3b11110e190a6869959f415b8dc7b (diff) | |
download | rspamd-3a58c2c32ff44781e0401d9c94906f41a8272ad3.tar.gz rspamd-3a58c2c32ff44781e0401d9c94906f41a8272ad3.zip |
[Minor] Avoid double session cleanup
-rw-r--r-- | src/libserver/events.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |