aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lua/lua_http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index c4dffa8f7..d7f8c74f4 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -1062,7 +1062,10 @@ lua_http_request (lua_State *L)
cbd->url = url;
cbd->auth = auth;
cbd->task = task;
- cbd->up = rspamd_upstream_ref(up);
+
+ if (up) {
+ cbd->up = rspamd_upstream_ref(up);
+ }
if (cbd->cbref == -1) {
cbd->thread = lua_thread_pool_get_running_entry (cfg->lua_thread_pool);