From fb86e3df22e94ccf9da31147f4c0eb3659b82558 Mon Sep 17 00:00:00 2001 From: Charlotte Meyer 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 7249ef3..3019f61 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");