]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check for NULL first for sanity
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 2 Jul 2022 12:37:29 +0000 (13:37 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 2 Jul 2022 12:37:29 +0000 (13:37 +0100)
src/lua/lua_http.c

index c4dffa8f7ae9eed3785173e44df1a7ad03fdfe05..d7f8c74f430753e4a543466737ce78f4b0c68a8b 100644 (file)
@@ -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);