Fix hiredis getaddrinfo leak

Fixed in Redis by 1a5e5b6, but since that part of code
is largely copy/paste from Redis, the fix needs to be
ported over too.

Closes #2012
This commit is contained in:
Matt Stancliff 2014-09-18 14:21:12 -04:00
parent 747b57cfb6
commit 56c1f8805e

1
deps/hiredis/net.c vendored
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));