summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nunberg <mnunberg@users.noreply.github.com>2019-08-09 03:44:25 -0400
committerGitHub <noreply@github.com>2019-08-09 03:44:25 -0400
commit99cdec371fc85e689e1d80761dbd50a2ce9c4c38 (patch)
tree6e2634da6eceaaf7d0a8598fbab6e00e9ac5cdf2
parentfbb83c4a7a290d6ff912a6e77dd2ad6dfac357af (diff)
parent918e24c83b2a6cecea089d1c335acb98b5c593e3 (diff)
Merge pull request #671 from movebean/master
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;