From 43c3e68d2f9d74c7066a6a867a6b69e74b380027 Mon Sep 17 00:00:00 2001 From: YeongJong Lee Date: Mon, 23 Apr 2018 13:39:32 -0700 Subject: [PATCH] edje_lua2: add null check Summary: It need to check memory allocation failures Reviewers: Jaehyun_Cho Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5971 Reviewed-by: Cedric BAIL --- src/lib/edje/edje_lua2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/edje/edje_lua2.c b/src/lib/edje/edje_lua2.c index b8a66c67c7..b204736439 100644 --- a/src/lib/edje/edje_lua2.c +++ b/src/lib/edje/edje_lua2.c @@ -3964,6 +3964,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage [-63, +99, em] _elua_init(); // This is actually truly pointless, even if raster remembers. #endif L = ed->L = luaL_newstate(); + if (!L) + { + ERR("Lua state assign failed"); + return; + } al = lua_newuserdata(L, sizeof(Edje_Lua_Allocator)); al->ref = luaL_ref(L, LUA_REGISTRYINDEX); al->func = lua_getallocf(L, &(al->ud));