From: Vsevolod Stakhov Date: Sat, 2 Jul 2022 12:35:22 +0000 (+0100) Subject: [Minor] Use upstreams refcounts X-Git-Tag: 3.3~152 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d6f8ba8d1efd06158ed9d9a678528e4be6690b2e;p=rspamd.git [Minor] Use upstreams refcounts --- 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);