From 9c0b821573b877fc8a7cd1f449cbc6d2eade8227 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Oct 2012 19:37:31 +0300 Subject: [PATCH] lua: fix ubus_lua_format_blob_is_array() to not leave garbage on the stack --- lua/ubus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.25.1