summaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-07-02 13:35:22 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-07-02 13:35:22 +0100
commitd6f8ba8d1efd06158ed9d9a678528e4be6690b2e (patch)
treeb6f6c127c4a51541dcf6405d29e84bfc07a61548 /src/lua
parentdccf92aa82ccca974a280c22708047ea2594e15a (diff)
downloadrspamd-d6f8ba8d1efd06158ed9d9a678528e4be6690b2e.tar.gz
rspamd-d6f8ba8d1efd06158ed9d9a678528e4be6690b2e.zip
[Minor] Use upstreams refcounts
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_http.c6
1 files changed, 5 insertions, 1 deletions
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);