diff options
Diffstat (limited to 'src/netops.c')
-rw-r--r-- | src/netops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/netops.c b/src/netops.c index 32554743f..b369e5106 100644 --- a/src/netops.c +++ b/src/netops.c @@ -381,16 +381,18 @@ int gitno_connect(git_transport *t, const char *host, const char *port) GIT_SOCKET s = INVALID_SOCKET; memset(&hints, 0x0, sizeof(struct addrinfo)); - hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; + hints.ai_family = AF_UNSPEC; - if ((ret = getaddrinfo(host, port, &hints, &info)) < 0) { - giterr_set(GITERR_NET, "Failed to resolve address for %s: %s", host, gai_strerror(ret)); + if ((ret = p_getaddrinfo(host, port, &hints, &info)) < 0) { + giterr_set(GITERR_NET, + "Failed to resolve address for %s: %s", host, p_gai_strerror(ret)); return -1; } for (p = info; p != NULL; p = p->ai_next) { s = socket(p->ai_family, p->ai_socktype, p->ai_protocol); + if (s == INVALID_SOCKET) { net_set_error("error creating socket"); break; @@ -411,7 +413,7 @@ int gitno_connect(git_transport *t, const char *host, const char *port) } t->socket = s; - freeaddrinfo(info); + p_freeaddrinfo(info); if (t->encrypt && ssl_setup(t, host) < 0) return -1; |