* fake-addrinfo.h (fai_add_hosts_by_name): Handle case where returned ai_canonname...
authorKen Raeburn <raeburn@mit.edu>
Mon, 23 Aug 2004 20:31:31 +0000 (20:31 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 23 Aug 2004 20:31:31 +0000 (20:31 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16682 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/fake-addrinfo.h

index f92a08ce813633f043c83ff799f35fb10d4fe467..495c4eca57e27cd26534adfe6ada5421d41f829b 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-23  Ken Raeburn  <raeburn@mit.edu>
+
+       * fake-addrinfo.h (fai_add_hosts_by_name): Handle case where
+       returned ai_canonname is null.
+
 2004-08-14  Ken Raeburn  <raeburn@mit.edu>
 
        * k5-thread.h (k5_os_nothread_mutex_assert_locked,
index 8b9639365de72f3c4d92f375e88113fca0ef5f85..2e11fefd1ce6fe302eb54013ae4d21192e29dcb2 100644 (file)
@@ -787,7 +787,7 @@ static inline int fai_add_hosts_by_name (const char *name,
                break;
            }
        }
-       ce->canonname = strdup(ai->ai_canonname);
+       ce->canonname = ai->ai_canonname ? strdup(ai->ai_canonname) : 0;
        system_freeaddrinfo(ai);
        plant_face(name, ce);
     }
@@ -810,7 +810,9 @@ static inline int fai_add_hosts_by_name (const char *name,
        }
     }
     if (*result && (flags & AI_CANONNAME))
-       (*result)->ai_canonname = strdup(ce->canonname);
+       (*result)->ai_canonname = (ce->canonname
+                                  ? strdup(ce->canonname)
+                                  : NULL);
     krb5int_unlock_fac();
     return 0;