redisReaderGetReply leak memory

This commit is contained in:
qi.yang 2019-05-30 15:03:38 +08:00
parent f5f855c912
commit 918e24c83b

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;