]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid double session cleanup
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 1 Feb 2017 13:13:40 +0000 (13:13 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 1 Feb 2017 13:13:40 +0000 (13:13 +0000)
src/libserver/events.c

index 44a5d9191604c711dd72dd5f42047233a8a1dbef..2c8f9999c1e61b839e6e7340c1825e5e0dc84fa1 100644 (file)
@@ -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;