summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqi.yang <q_yang1987@163.com>2019-05-30 15:03:38 +0800
committerqi.yang <q_yang1987@163.com>2019-05-30 15:03:38 +0800
commit918e24c83b2a6cecea089d1c335acb98b5c593e3 (patch)
treee7f65762a65cfff73131a24762d1e8c58203ab17
parentf5f855c91239706b173e2412cea301f4a3643e2d (diff)
redisReaderGetReply leak memory
-rw-r--r--read.c5
1 files changed, 4 insertions, 1 deletions
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;