diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c index a225f9b0fd..3ccd3905fa 100644 --- a/nss/getaddrinfo.c +++ b/nss/getaddrinfo.c @@ -615,7 +615,14 @@ get_nss_addresses (const char *name, const struct addrinfo *req, function variant. */ res_ctx = __resolv_context_get (); if (res_ctx == NULL) - no_more = 1; + { + if (errno == ENOMEM) + { + result = -EAI_MEMORY; + goto out; + } + no_more = 1; + } while (!no_more) {