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 <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2024-11-07 13:44:21 +08:00 committed by GitHub
parent 22bc49c4a6
commit 1c18c80844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {