summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-06-11 12:46:55 +0200
committerantirez <antirez@gmail.com>2015-06-11 14:34:38 +0200
commit8fa8b251a9766f987a7704f034e66c645f0c3afe (patch)
treef1f55d50d326e9de46863d30f9457fa288d13035
parenta401a84eb2fb0b22e003cdd2c5231995f57bab8b (diff)
downloadredis-8fa8b251a9766f987a7704f034e66c645f0c3afe.tar.gz
anetTcpGenericConnect(), jump to error not end on error
Two code paths jumped to the "ok, return the socket to the user" code path to handle error conditions. Related to issues #2609 and #2612.
-rw-r--r--src/anet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/anet.c b/src/anet.c
index 3ef517cec..bdaba8b0f 100644
--- a/src/anet.c
+++ b/src/anet.c
@@ -295,7 +295,7 @@ static int anetTcpGenericConnect(char *err, char *addr, int port,
if ((rv = getaddrinfo(source_addr, NULL, &hints, &bservinfo)) != 0)
{
anetSetError(err, "%s", gai_strerror(rv));
- goto end;
+ goto error;
}
for (b = bservinfo; b != NULL; b = b->ai_next) {
if (bind(s,b->ai_addr,b->ai_addrlen) != -1) {
@@ -306,7 +306,7 @@ static int anetTcpGenericConnect(char *err, char *addr, int port,
freeaddrinfo(bservinfo);
if (!bound) {
anetSetError(err, "bind: %s", strerror(errno));
- goto end;
+ goto error;
}
}
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {