Merge pull request #671 from movebean/master

redisReaderGetReply leak memory
This commit is contained in:
Mark Nunberg 2019-08-09 03:44:25 -04:00 committed by GitHub
commit 99cdec371f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
read.c
View File

@ -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;