Commit 3c4fe59e authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #3648 from dvirsky/fix_reply_crash

fix memory corruption on RM_FreeCallReply
parents 71e8d15e 8521cde5
...@@ -2286,8 +2286,10 @@ void RM_FreeCallReply_Rec(RedisModuleCallReply *reply, int freenested){ ...@@ -2286,8 +2286,10 @@ void RM_FreeCallReply_Rec(RedisModuleCallReply *reply, int freenested){
* to have the first level function to return on nested replies, but only * to have the first level function to return on nested replies, but only
* if called by the module API. */ * if called by the module API. */
void RM_FreeCallReply(RedisModuleCallReply *reply) { void RM_FreeCallReply(RedisModuleCallReply *reply) {
RedisModuleCtx *ctx = reply->ctx;
RM_FreeCallReply_Rec(reply,0); RM_FreeCallReply_Rec(reply,0);
autoMemoryFreed(reply->ctx,REDISMODULE_AM_REPLY,reply); autoMemoryFreed(ctx,REDISMODULE_AM_REPLY,reply);
} }
/* Return the reply type. */ /* Return the reply type. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment