From 62e6b5a336688680904edbfd4a7496e2808f3f0b Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Fri, 22 Oct 2021 02:13:17 +0900 Subject: [PATCH] guard lua_close() nhl_done() can be called with L == NULL. So lua_close() should be guarded. --- src/nhlua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nhlua.c b/src/nhlua.c index 92a942b92..db4deb6c4 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -1375,7 +1375,8 @@ nhl_init(void) void nhl_done(lua_State *L) { - lua_close(L); + if (L) + lua_close(L); iflags.in_lua = FALSE; }