diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 7fb816f3a2..6feccf2d08 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -208,6 +208,18 @@ Curl_getaddrinfo_ex(const char *nodename, Curl_freeaddrinfo(cafirst); cafirst = NULL; } + else if(!cafirst) { +#ifdef EAI_NONAME + /* rfc3493 conformant */ + error = EAI_NONAME; +#else + /* rfc3493 obsoleted */ + error = EAI_NODATA; +#endif +#ifdef USE_WINSOCK + SET_SOCKERRNO(error); +#endif + } *result = cafirst;