commit 3089d89: [Minor] Fix another deinit race

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Feb 27 14:28:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-26 16:29:45 +0000
URL: https://github.com/rspamd/rspamd/commit/3089d894c57e2326db35f6c96224e0a005d803e6

[Minor] Fix another deinit race

---
 src/controller.c    | 4 +++-
 src/fuzzy_storage.c | 3 ++-
 src/rspamd_proxy.c  | 3 ++-
 src/worker.c        | 3 ++-
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/controller.c b/src/controller.c
index 87ac965ec..ac1acae81 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -3942,8 +3942,10 @@ start_controller_worker (struct rspamd_worker *worker)
 
 	g_hash_table_unref (ctx->plugins);
 	g_hash_table_unref (ctx->custom_commands);
+
+	struct rspamd_http_context *http_ctx = ctx->http_ctx;
 	REF_RELEASE (ctx->cfg);
-	rspamd_http_context_free (ctx->http_ctx);
+	rspamd_http_context_free (http_ctx);
 	rspamd_log_close (worker->srv->logger, TRUE);
 
 	exit (EXIT_SUCCESS);
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 50a99f030..7fdce82ae 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -3235,8 +3235,9 @@ start_fuzzy (struct rspamd_worker *worker)
 		rspamd_keypair_cache_destroy (ctx->keypair_cache);
 	}
 
+	struct rspamd_http_context *http_ctx = ctx->http_ctx;
 	REF_RELEASE (ctx->cfg);
-	rspamd_http_context_free (ctx->http_ctx);
+	rspamd_http_context_free (http_ctx);
 	rspamd_log_close (worker->srv->logger, TRUE);
 
 	exit (EXIT_SUCCESS);
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 4add6cc22..b6ede29b9 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -2213,8 +2213,9 @@ start_rspamd_proxy (struct rspamd_worker *worker)
 		rspamd_stat_close ();
 	}
 
+	struct rspamd_http_context *http_ctx = ctx->http_ctx;
 	REF_RELEASE (ctx->cfg);
-	rspamd_http_context_free (ctx->http_ctx);
+	rspamd_http_context_free (http_ctx);
 	rspamd_log_close (worker->srv->logger, TRUE);
 
 	exit (EXIT_SUCCESS);
diff --git a/src/worker.c b/src/worker.c
index 920ee7f72..d81be54a1 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -703,8 +703,9 @@ start_worker (struct rspamd_worker *worker)
 	rspamd_worker_block_signals ();
 
 	rspamd_stat_close ();
+	struct rspamd_http_context *http_ctx = ctx->http_ctx;
 	REF_RELEASE (ctx->cfg);
-	rspamd_http_context_free (ctx->http_ctx);
+	rspamd_http_context_free (http_ctx);
 	rspamd_log_close (worker->srv->logger, TRUE);
 
 	exit (EXIT_SUCCESS);


More information about the Commits mailing list