Closed
Description
With this simple code :
#include <hiredis.h> int main(void) { int i = 0; int fd; redisConnect(&fd, "127.0.0.1", 6379); for (i = 0 ; i < 1000 ; i++) { redisReply *coucou = redisCommand(fd, "%s %s", "SCARD", "foo"); freeReplyObject(coucou); } }
I get a memory leak with valgrind :
valgrind --leak-check=full ./a.out ==22961== 19,000 bytes in 1,000 blocks are definitely lost in loss record 1 of 1 ==22961== at 0x4A0776F: realloc (vg_replace_malloc.c:429) ==22961== by 0x4C36A7F: sdsMakeRoomFor (sds.c:108) ==22961== by 0x4C36E88: sdscatlen (sds.c:123) ==22961== by 0x4C3624B: redisReadLine (hiredis.c:111) ==22961== by 0x4C36356: redisReadReply (hiredis.c:125) ==22961== by 0x4C36757: redisCommand (hiredis.c:297) ==22961== by 0x4006AF: main (toto.c:8)
With a string reply, I don't have this.
Maybe I'm missing something ? Or is there a real memory leak in hiredis ?
Metadata
Metadata
Assignees
Labels
No labels