From d99457c09cefed8afdc112dbce3d3bee29e555a5 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 8 Jan 2025 22:35:48 -0800 Subject: [PATCH] Free the passed in lua context instead of the global (#1536) The fix that Redis gave us for the CVE-2024-46981 was freeing lctx.lua, and I didn't merge it correctly. We made some changes so that we are able to async free the lua context, so we need to free the passed in context. This was applied correctly on the two released versions (8.0 and 7.2) just not on unstable. Signed-off-by: Madelyn Olson --- src/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 9aa185d77b..62780447a9 100644 --- a/src/eval.c +++ b/src/eval.c @@ -285,7 +285,7 @@ void scriptingInit(int setup) { void freeLuaScriptsSync(dict *lua_scripts, list *lua_scripts_lru_list, lua_State *lua) { dictRelease(lua_scripts); listRelease(lua_scripts_lru_list); - lua_gc(lctx.lua, LUA_GCCOLLECT, 0); + lua_gc(lua, LUA_GCCOLLECT, 0); lua_close(lua); #if !defined(USE_LIBC)