diff options
author | Mark Nunberg <mnunberg@users.noreply.github.com> | 2019-08-09 03:44:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 03:44:25 -0400 |
commit | 99cdec371fc85e689e1d80761dbd50a2ce9c4c38 (patch) | |
tree | 6e2634da6eceaaf7d0a8598fbab6e00e9ac5cdf2 | |
parent | fbb83c4a7a290d6ff912a6e77dd2ad6dfac357af (diff) | |
parent | 918e24c83b2a6cecea089d1c335acb98b5c593e3 (diff) |
Merge pull request #671 from movebean/master
redisReaderGetReply leak memory
-rw-r--r-- | read.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |