]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Release redis pool after Lua state has been destroyed
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Oct 2021 09:03:37 +0000 (10:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 Oct 2021 09:03:37 +0000 (10:03 +0100)
src/libserver/cfg_utils.c

index 5c2bd63d7d9f5ebe3d250bfa523af7db1c813d50..cf80599ed54657070207b59d0bc59b58f04c0f73 100644 (file)
@@ -336,12 +336,6 @@ rspamd_config_free (struct rspamd_config *cfg)
        rspamd_re_cache_unref (cfg->re_cache);
        g_ptr_array_free (cfg->c_modules, TRUE);
 
-#ifdef WITH_HIREDIS
-       if (cfg->redis_pool) {
-               rspamd_redis_pool_destroy (cfg->redis_pool);
-       }
-#endif
-
        if (cfg->monitored_ctx) {
                rspamd_monitored_ctx_destroy (cfg->monitored_ctx);
        }
@@ -351,6 +345,12 @@ rspamd_config_free (struct rspamd_config *cfg)
                lua_close (cfg->lua_state);
        }
 
+#ifdef WITH_HIREDIS
+       if (cfg->redis_pool) {
+               rspamd_redis_pool_destroy (cfg->redis_pool);
+       }
+#endif
+
        rspamd_upstreams_library_unref (cfg->ups_ctx);
        HASH_CLEAR (hh, cfg->actions);