From 408763f32676fa60e74cb202486be4b17a43974e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 3 May 2011 17:29:35 +0200 Subject: getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r Also, freeaddrinfo(NULL) is ok, no need to check parameted for NULL before calling it. Signed-off-by: Denys Vlasenko --- libc/inet/getaddrinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/inet/getaddrinfo.c') diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index e619effa1..1a77c5199 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -649,7 +649,7 @@ gaih_inet(const char *name, const struct gaih_service *service, at2->family, &th, tmpbuf, tmpbuflen, &h, &herrno); - } while (rc == errno && herrno == NETDB_INTERNAL); + } while (rc == ERANGE && herrno == NETDB_INTERNAL); if (rc != 0 && herrno == NETDB_INTERNAL) { __set_h_errno(herrno); @@ -855,7 +855,7 @@ getaddrinfo(const char *name, const char *service, last_i = i; if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC)) continue; - if (p) + /*if (p) - freeaddrinfo works ok on NULL too */ freeaddrinfo(p); return -(i & GAIH_EAI); } -- cgit v1.2.3