From 84c09bbc0189ad3aed6570716eb3c4870f5d15a6 Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 14 Sep 2021 12:15:54 +0000 Subject: [PATCH] Add check to adjust_package_path --- kiwmi/luak/luak.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kiwmi/luak/luak.c b/kiwmi/luak/luak.c index 8db884c..3d4945c 100644 --- a/kiwmi/luak/luak.c +++ b/kiwmi/luak/luak.c @@ -263,7 +263,13 @@ luaK_create(struct kiwmi_server *server) "package.path = KIWMI_CONFIGDIR .. '/?.lua;' .. package.path\n" "package.path = KIWMI_CONFIGDIR .. '/?/init.lua;' .. package.path\n"; - luaL_dostring(L, adjust_package_path); + if (luaL_dostring(L, adjust_package_path)) { + // shouldn't fail + wlr_log(WLR_ERROR, "Error in adjust_package_path"); + lua_close(L); + free(lua); + return NULL; + } if (!luaK_ipc_init(server, lua)) { wlr_log(WLR_ERROR, "Failed to initialize IPC");