mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
Modules: Invalidate saved_oparray after use (#7688)
We wanna avoid a chance of someone using the pointer in it after it'll be freed / realloced.
This commit is contained in:
parent
cbaf3c5bba
commit
65c24bd3d4
@ -609,6 +609,8 @@ void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
|
||||
redisOpArrayFree(&server.also_propagate);
|
||||
/* Restore the previous oparray in case of nexted use of the API. */
|
||||
server.also_propagate = ctx->saved_oparray;
|
||||
/* We're done with saved_oparray, let's invalidate it. */
|
||||
redisOpArrayInit(&ctx->saved_oparray);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user