about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index d87b965b27..d72457af10 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -362,6 +362,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   int rc;
   bool got_ipv6 = false;
   const char *canon = NULL;
+  const char *orig_name = name;
 
   if (req->ai_protocol || req->ai_socktype)
     {
@@ -778,10 +779,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		  canon = h->h_name;
 		else
 		  {
-		    assert (name != NULL);
+		    assert (orig_name != NULL);
 		    /* If the canonical name cannot be determined, use
 		       the passed in string.  */
-		    canon = name;
+		    canon = orig_name;
 		  }
 	      }