From 1c18c8084451153c468e3224f31da43ff6fbd615 Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 7 Nov 2024 13:44:21 +0800 Subject: [PATCH] Fix incorrect cache_memory reset in functionsLibCtxClear (#1255) functionsLibCtxClear should clear the provided lib_ctx parameter, not the static variable curr_functions_lib_ctx, as this contradicts the function's intended purpose. The impact i guess is minor, like in some unhappy paths (diskless load fails, function restore fails?), we will mess up the functions_caches field, which is used in used_memory_functions / used_memory_scripts fileds in INFO. Signed-off-by: Binbin --- src/functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions.c b/src/functions.c index a00fefb32..e950024ba 100644 --- a/src/functions.c +++ b/src/functions.c @@ -175,7 +175,7 @@ void functionsLibCtxClear(functionsLibCtx *lib_ctx) { stats->n_lib = 0; } dictReleaseIterator(iter); - curr_functions_lib_ctx->cache_memory = 0; + lib_ctx->cache_memory = 0; } void functionsLibCtxClearCurrent(int async) {