summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/hostip4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/hostip4.c')
-rw-r--r--libs/libcurl/src/hostip4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/libcurl/src/hostip4.c b/libs/libcurl/src/hostip4.c
index b658ff56ab..10d91471a1 100644
--- a/libs/libcurl/src/hostip4.c
+++ b/libs/libcurl/src/hostip4.c
@@ -126,8 +126,10 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
int res;
#endif
struct Curl_addrinfo *ai = NULL;
+#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE))
struct hostent *h = NULL;
struct hostent *buf = NULL;
+#endif
#if defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE)
struct addrinfo hints;
@@ -288,12 +290,14 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
#endif /* (HAVE_GETADDRINFO && HAVE_GETADDRINFO_THREADSAFE) ||
HAVE_GETHOSTBYNAME_R */
+#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE))
if(h) {
ai = Curl_he2ai(h, port);
if(buf) /* used a *_r() function */
free(buf);
}
+#endif
return ai;
}