(krb5_sname_to_principal): handle not getting back a canonname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7731 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -886,11 +886,11 @@ krb5_sname_to_principal (krb5_context context,
|
||||
|
||||
error = getaddrinfo (hostname, NULL, &hints, &res);
|
||||
if (error == 0) {
|
||||
host = strdup (res->ai_canonname);
|
||||
if (res->ai_canonname != NULL)
|
||||
host = strdup (res->ai_canonname);
|
||||
else
|
||||
host = strdup (hostname);
|
||||
freeaddrinfo (res);
|
||||
} else if (res->ai_canonname == NULL) {
|
||||
freeaddrinfo (res);
|
||||
host = strdup (hostname);
|
||||
} else {
|
||||
host = strdup (hostname);
|
||||
}
|
||||
|
Reference in New Issue
Block a user