diff options
Diffstat (limited to 'apps/plugins/lua/lauxlib.c')
-rw-r--r-- | apps/plugins/lua/lauxlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/plugins/lua/lauxlib.c b/apps/plugins/lua/lauxlib.c index b8332427f0..9a5939aff9 100644 --- a/apps/plugins/lua/lauxlib.c +++ b/apps/plugins/lua/lauxlib.c | |||
@@ -803,8 +803,10 @@ static int panic (lua_State *L) { | |||
803 | 803 | ||
804 | LUALIB_API lua_State *luaL_newstate (void) { | 804 | LUALIB_API lua_State *luaL_newstate (void) { |
805 | lua_State *L = lua_newstate(l_alloc, NULL); | 805 | lua_State *L = lua_newstate(l_alloc, NULL); |
806 | lua_setallocf(L, l_alloc, L); /* allocator needs lua_State. */ | 806 | if (L){ |
807 | if (L) lua_atpanic(L, &panic); | 807 | lua_setallocf(L, l_alloc, L); /* allocator needs lua_State. */ |
808 | lua_atpanic(L, &panic); | ||
809 | } | ||
808 | return L; | 810 | return L; |
809 | } | 811 | } |
810 | 812 | ||