Move freeaddrinfo() call after failure-reporting loop.

This commit is contained in:
Wayne Davison
2011-07-11 18:15:51 -07:00
parent 30fb28cc97
commit 5fed6c076a

View File

@@ -299,7 +299,6 @@ int open_socket_out(char *host, int port, const char *bind_addr,
}
break;
}
freeaddrinfo(res0);
if (s < 0) {
char buf[2048];
@@ -313,6 +312,7 @@ int open_socket_out(char *host, int port, const char *bind_addr,
s = -1;
}
freeaddrinfo(res0);
free(errnos);
return s;