From 8bb34756ce2bd684745d3a49a134dae03073b452 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 20 Jan 2016 14:59:04 +0100 Subject: [PATCH] lua: fix stack leak in ubus method handling Signed-off-by: Chen Bin Signed-off-by: Felix Fietkau --- lua/ubus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/ubus.c b/lua/ubus.c index 2903e7b..86e34b7 100644 --- a/lua/ubus.c +++ b/lua/ubus.c @@ -302,8 +302,9 @@ ubus_method_handler(struct ubus_context *ctx, struct ubus_object *obj, lua_call(state, 2, 1); if (lua_isnumber(state, -1)) rv = lua_tonumber(state, -1); - } else - lua_pop(state, 1); + } + + lua_pop(state, 1); return rv; } -- 2.25.1