Add check for return value for luaL_newstate

This commit is contained in:
Pavel Odintsov 2015-06-23 17:39:04 -04:00
parent 025cce6012
commit 50311128c7

View File

@ -1033,6 +1033,13 @@ void init_lua_jit() {
if (lua_hooks_enabled) {
lua_state = luaL_newstate();
if (lua_state == NULL) {
logger << log4cpp::Priority::ERROR << "Can't create LUA session";
lua_hooks_enabled = false;
return;
}
// load libraries
luaL_openlibs(lua_state);