diff options
author | antirez <antirez@gmail.com> | 2010-08-30 15:42:24 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2010-08-30 15:42:24 +0200 |
commit | e7aa0b4b5244b7c8a508067b2836b3f7e7137552 (patch) | |
tree | f12bb3cbf5a0f57d95eded1137b9b15a8e54d96b | |
parent | 4b5f030d4fa41156390b38d6db8842de78f19dba (diff) |
memory leak resolved in redisReadIntegerReply
-rw-r--r-- | hiredis.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -126,7 +126,10 @@ static redisReply *redisReadIntegerReply(int fd) { redisReply *r = malloc(sizeof(*r)); if (r == NULL) redisOOM(); - if (buf == NULL) return redisIOError(); + if (buf == NULL) { + free(r); + return redisIOError(); + } r->type = REDIS_REPLY_INTEGER; r->integer = strtoll(buf,NULL,10); sdsfree(buf); |