From 918e24c83b2a6cecea089d1c335acb98b5c593e3 Mon Sep 17 00:00:00 2001 From: "qi.yang" Date: Thu, 30 May 2019 15:03:38 +0800 Subject: [PATCH] redisReaderGetReply leak memory --- read.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/read.c b/read.c index cc21267..065b0b5 100644 --- a/read.c +++ b/read.c @@ -590,8 +590,11 @@ int redisReaderGetReply(redisReader *r, void **reply) { /* Emit a reply when there is one. */ if (r->ridx == -1) { - if (reply != NULL) + if (reply != NULL) { *reply = r->reply; + } else if (r->reply != NULL && r->fn && r->fn->freeObject) { + r->fn->freeObject(r->reply); + } r->reply = NULL; } return REDIS_OK;