]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix cleanup
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 Feb 2019 16:01:17 +0000 (16:01 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 Feb 2019 16:01:17 +0000 (16:01 +0000)
src/controller.c
src/fuzzy_storage.c
src/libutil/http_context.c
src/rspamd_proxy.c
src/worker.c

index 350745f3c2166820d558e21c008da2957ae61f7f..87ac965ec98a96308a53975fc98ae126b6f7194f 100644 (file)
@@ -3942,8 +3942,8 @@ start_controller_worker (struct rspamd_worker *worker)
 
        g_hash_table_unref (ctx->plugins);
        g_hash_table_unref (ctx->custom_commands);
-       rspamd_http_context_free (ctx->http_ctx);
        REF_RELEASE (ctx->cfg);
+       rspamd_http_context_free (ctx->http_ctx);
        rspamd_log_close (worker->srv->logger, TRUE);
 
        exit (EXIT_SUCCESS);
index 8dae4fb4bccd919fcdb5e3e8babea6e0cecf0e8c..50a99f030a81120452de9be0b2bfecc130067967 100644 (file)
@@ -3235,8 +3235,8 @@ start_fuzzy (struct rspamd_worker *worker)
                rspamd_keypair_cache_destroy (ctx->keypair_cache);
        }
 
-       rspamd_http_context_free (ctx->http_ctx);
        REF_RELEASE (ctx->cfg);
+       rspamd_http_context_free (ctx->http_ctx);
        rspamd_log_close (worker->srv->logger, TRUE);
 
        exit (EXIT_SUCCESS);
index 39a02b179d30fb29f3bb2f37e21318447ac4bd20..87540eee801021b8a1fc00288a9ecac95a942188 100644 (file)
@@ -176,6 +176,14 @@ rspamd_http_context_free (struct rspamd_http_context *ctx)
                rspamd_keypair_cache_destroy (ctx->server_kp_cache);
        }
 
+       if (ctx->config.client_key_rotate_time > 0) {
+               event_del (&ctx->client_rotate_ev);
+
+               if (ctx->client_kp) {
+                       rspamd_keypair_unref (ctx->client_kp);
+               }
+       }
+
        g_free (ctx);
 }
 
index e25a66cafe008c39089f9b73148bdd81dddd014c..4add6cc2252bc9d92c8ab9642be4900c3c961e4c 100644 (file)
@@ -2213,8 +2213,8 @@ start_rspamd_proxy (struct rspamd_worker *worker)
                rspamd_stat_close ();
        }
 
-       rspamd_http_context_free (ctx->http_ctx);
        REF_RELEASE (ctx->cfg);
+       rspamd_http_context_free (ctx->http_ctx);
        rspamd_log_close (worker->srv->logger, TRUE);
 
        exit (EXIT_SUCCESS);
index 0e993b84c6040e2cfa7d931a24e6b8c980d4d12f..920ee7f72a8b634450570bcd7f54603892b455d6 100644 (file)
@@ -703,8 +703,8 @@ start_worker (struct rspamd_worker *worker)
        rspamd_worker_block_signals ();
 
        rspamd_stat_close ();
-       rspamd_http_context_free (ctx->http_ctx);
        REF_RELEASE (ctx->cfg);
+       rspamd_http_context_free (ctx->http_ctx);
        rspamd_log_close (worker->srv->logger, TRUE);
 
        exit (EXIT_SUCCESS);