]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db-lua - Use luaL_error correctly
authorAki Tuomi <aki.tuomi@dovecot.fi>
Sat, 20 Jan 2018 18:33:01 +0000 (20:33 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Mar 2018 07:05:03 +0000 (09:05 +0200)
src/auth/db-lua.c

index 17e29d8479939a1b9c1a057234d2ad4b722609a6..c7bee974dedc85d7312252f53aaa35fde401c6a1 100644 (file)
@@ -58,7 +58,7 @@ static int auth_request_lua_var_expand(lua_State *L)
        const char *value, *error;
 
        if (auth_request_lua_do_var_expand(req, tpl, &value, &error) < 0) {
-               luaL_error(L, error);
+               return luaL_error(L, error);
        } else {
                lua_pushstring(L, value);
        }
@@ -109,8 +109,7 @@ static int auth_request_lua_response_from_template(lua_State *L)
                if (value == NULL) {
                        lua_pushnil(L);
                } else if (auth_request_lua_do_var_expand(req, value, &expanded, &error) < 0) {
-                       luaL_error(L, error);
-                       break;
+                       return luaL_error(L, error);
                } else {
                        lua_pushstring(L, expanded);
                }