Curl_getaddrinfo_ex: sanitize function results follow-up.

This commit is contained in:
Yang Tse 2010-11-24 04:36:57 +01:00
parent 6fe18add71
commit 1d75d30816

View File

@ -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;