From d6f8ba8d1efd06158ed9d9a678528e4be6690b2e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 2 Jul 2022 13:35:22 +0100 Subject: [PATCH] [Minor] Use upstreams refcounts --- src/lua/lua_http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 5a05f7058..c4dffa8f7 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -128,6 +128,10 @@ lua_http_fin (gpointer arg) rspamd_inet_address_free (cbd->addr); } + if (cbd->up) { + rspamd_upstream_unref(cbd->up); + } + if (cbd->mime_type) { g_free (cbd->mime_type); } @@ -1058,7 +1062,7 @@ lua_http_request (lua_State *L) cbd->url = url; cbd->auth = auth; cbd->task = task; - cbd->up = up; + cbd->up = rspamd_upstream_ref(up); if (cbd->cbref == -1) { cbd->thread = lua_thread_pool_get_running_entry (cfg->lua_thread_pool); -- 2.39.5