From: Jo-Philipp Wich Date: Tue, 16 Oct 2012 16:37:31 +0000 (+0300) Subject: lua: fix ubus_lua_format_blob_is_array() to not leave garbage on the stack X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=commitdiff_plain;h=9c0b821573b877fc8a7cd1f449cbc6d2eade8227 lua: fix ubus_lua_format_blob_is_array() to not leave garbage on the stack --- diff --git a/lua/ubus.c b/lua/ubus.c index 081ff45..bdf924a 100644 --- a/lua/ubus.c +++ b/lua/ubus.c @@ -137,7 +137,7 @@ ubus_lua_format_blob_is_array(lua_State *L) if (lua_type(L, -2) != LUA_TNUMBER) #endif { - lua_pop(L, 1); + lua_pop(L, 2); return false; } @@ -145,13 +145,14 @@ ubus_lua_format_blob_is_array(lua_State *L) if ((cur - 1) != prv) { - lua_pop(L, 1); + lua_pop(L, 2); return false; } prv = cur; } + lua_pop(L, 1); return true; }