Merge pull request #274 from mattsta/fix-memory-leak

Fix getaddrinfo() memory leak
This commit is contained in:
Salvatore Sanfilippo 2014-09-19 12:48:48 +02:00
commit 8f60ee6532

1
net.c
View File

@ -300,6 +300,7 @@ static int _redisContextConnectTcp(redisContext *c, const char *addr, int port,
break; break;
} }
} }
freeaddrinfo(bservinfo);
if (!bound) { if (!bound) {
char buf[128]; char buf[128];
snprintf(buf,sizeof(buf),"Can't bind socket: %s",strerror(errno)); snprintf(buf,sizeof(buf),"Can't bind socket: %s",strerror(errno));