]> sourceware.org Git - glibc.git/commitdiff
getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
authorAndreas Schwab <schwab@suse.de>
Wed, 6 Dec 2023 13:48:22 +0000 (14:48 +0100)
committerAndreas Schwab <schwab@suse.de>
Tue, 2 Jan 2024 10:10:42 +0000 (11:10 +0100)
When __resolv_context_get returns NULL due to out of memory, translate it
to a return value of EAI_MEMORY.

nss/getaddrinfo.c

index a225f9b0fd497a14c4da35ca6922b58de3fa273d..3ccd3905fa0f07c58fe78ba559c9eb89294c0f8f 100644 (file)
@@ -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)
     {
This page took 0.050663 seconds and 5 git commands to generate.