From 790215124eea93d9af7f30beb7208c9ebd8ef717 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 16 Dec 1999 11:48:25 +0000 Subject: [PATCH] (krb5_sname_to_principal): handle ai_canonname not being set git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7608 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/principal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/krb5/principal.c b/lib/krb5/principal.c index 4bd526b62..7715cbd31 100644 --- a/lib/krb5/principal.c +++ b/lib/krb5/principal.c @@ -888,6 +888,9 @@ krb5_sname_to_principal (krb5_context context, if (error == 0) { host = strdup (res->ai_canonname); freeaddrinfo (res); + } else if (res->ai_canonname == NULL) { + freeaddrinfo (res); + host = strdup (hostname); } else { host = strdup (hostname); }