diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-09 16:43:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-09 16:43:40 +0000 |
commit | c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16 (patch) | |
tree | e8742046ad3eac446a64576f9bfd605e583e9ee5 /src/lua/lua_upstream.c | |
parent | dcbe3146b882a731e1cd82025607bd423bb82024 (diff) | |
download | rspamd-c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16.tar.gz rspamd-c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16.zip |
Fix some issues found by coverity
Diffstat (limited to 'src/lua/lua_upstream.c')
-rw-r--r-- | src/lua/lua_upstream.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_upstream.c b/src/lua/lua_upstream.c index d168597d3..be745206f 100644 --- a/src/lua/lua_upstream.c +++ b/src/lua/lua_upstream.c @@ -176,7 +176,7 @@ lua_upstream_list_create (lua_State *L) guint default_port = 0; def = luaL_checkstring (L, 2); - if (def) { + if (def && cfg) { if (lua_gettop (L) >= 3) { default_port = luaL_checknumber (L, 3); } @@ -193,6 +193,9 @@ lua_upstream_list_create (lua_State *L) lua_pushnil (L); } } + else { + lua_error (L); + } return 1; } |