Use auxiliary variable to store reply before free'ing the list
This commit is contained in:
parent
62c8054dbe
commit
c18b58899e
@ -274,6 +274,7 @@ static int processItem(redisReader *r) {
|
|||||||
|
|
||||||
#define READ_BUFFER_SIZE 2048
|
#define READ_BUFFER_SIZE 2048
|
||||||
static redisReply *redisReadReply(int fd) {
|
static redisReply *redisReadReply(int fd) {
|
||||||
|
redisReply *reply;
|
||||||
redisReader r;
|
redisReader r;
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
@ -319,9 +320,10 @@ static redisReply *redisReadReply(int fd) {
|
|||||||
if (processItem(&r) < 0)
|
if (processItem(&r) < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
reply = r.rlist[0];
|
||||||
free(r.buf);
|
free(r.buf);
|
||||||
free(r.rlist);
|
free(r.rlist);
|
||||||
return r.rlist[0];
|
return reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper function for redisCommand(). It's used to append the next argument
|
/* Helper function for redisCommand(). It's used to append the next argument
|
||||||
|
Loading…
Reference in New Issue
Block a user