mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
When __resolv_context_get returns NULL due to out of memory, translate it to a return value of EAI_MEMORY.
This commit is contained in:
parent
4b00532e51
commit
5eabdb6a6a
1 changed files with 8 additions and 1 deletions
|
@ -615,7 +615,14 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
|
||||||
function variant. */
|
function variant. */
|
||||||
res_ctx = __resolv_context_get ();
|
res_ctx = __resolv_context_get ();
|
||||||
if (res_ctx == NULL)
|
if (res_ctx == NULL)
|
||||||
no_more = 1;
|
{
|
||||||
|
if (errno == ENOMEM)
|
||||||
|
{
|
||||||
|
result = -EAI_MEMORY;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
no_more = 1;
|
||||||
|
}
|
||||||
|
|
||||||
while (!no_more)
|
while (!no_more)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue