Skip to content

Commit

Permalink
Free the passed in lua context instead of the global (#1536)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
madolson authored Jan 9, 2025
1 parent b207b42 commit d99457c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d99457c

Please sign in to comment.