lua: fix stack leak in ubus method handling

Signed-off-by: Chen Bin <ewolfok@126.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2016-01-20 14:59:04 +01:00
parent 1d2b3bbdbe
commit 8bb34756ce

View file

@ -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;
}