From: Vsevolod Stakhov Date: Fri, 5 Aug 2016 15:05:13 +0000 (+0100) Subject: [Minor] Small fixes to lua stack management X-Git-Tag: 1.3.2~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1dc23f0aef838ead2485d71df6c0d46fd6a7b032;p=rspamd.git [Minor] Small fixes to lua stack management --- diff --git a/src/lua/lua_html.c b/src/lua/lua_html.c index 330c08fa8..f21432e9f 100644 --- a/src/lua/lua_html.c +++ b/src/lua/lua_html.c @@ -411,16 +411,17 @@ lua_html_node_foreach_cb (GNode *n, gpointer d) lua_pushnumber (ud->L, tag->content_length); if (lua_pcall (ud->L, 2, 1, 0) != 0) { - lua_settop (ud->L, 0); + msg_err ("error in foreach_tag callback: %s", lua_tostring (ud->L, -1)); + lua_pop (ud->L, 1); return TRUE; } if (lua_toboolean (ud->L, -1)) { - lua_settop (ud->L, 0); + lua_pop (ud->L, 1); return TRUE; } - lua_settop (ud->L, 0); + lua_pop (ud->L, 1); } return FALSE;