Skip to content

Commit

Permalink
memory leak resolved in redisReadIntegerReply
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Aug 30, 2010
1 parent 4b5f030 commit e7aa0b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hiredis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7aa0b4

Please sign in to comment.