]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fixed argument check 2559/head
authorMikhail Galanin <mgalanin@mimecast.com>
Tue, 2 Oct 2018 17:36:09 +0000 (18:36 +0100)
committerMikhail Galanin <mgalanin@mimecast.com>
Tue, 2 Oct 2018 17:36:09 +0000 (18:36 +0100)
ev_base should be passed into lua_http.request(). It comes either from task or explicitly

src/lua/lua_http.c

index 96872108cf261b37b5b74db653517fadca5311d4..47402148522405b473100d65a71d4eff72ed9dd4 100644 (file)
@@ -854,6 +854,9 @@ lua_http_request (lua_State *L)
        if (task == NULL && cfg == NULL) {
                return luaL_error (L, "Bad params to rspamd_http:request(): either task or config should be set");
        }
+       if (ev_base == NULL) {
+               return luaL_error (L, "Bad params to rspamd_http:request(): ev_base isn't passed");
+       }
 
        cbd = g_malloc0 (sizeof (*cbd));
        cbd->cbref = cbref;