summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--plugins/lua/lua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c
index d73fbb23..d1370eaf 100644
--- a/plugins/lua/lua.c
+++ b/plugins/lua/lua.c
@@ -1189,11 +1189,11 @@ static void patch_clibs(lua_State *L)
 		if(lua_type(L, -2) == LUA_TLIGHTUSERDATA && lua_type(L, -1) == LUA_TTABLE)
 		{
 			lua_setfield(L, LUA_REGISTRYINDEX, "_CLIBS");
+			lua_pop(L, 1);
 			break;
 		}
 		lua_pop(L, 1);
 	}
-	lua_pop(L, 1);
 }
 
 static GPtrArray *scripts;