add some krb5_{set,clear}_error_string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9937 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -41,8 +41,10 @@ copy_hostname(krb5_context context,
|
||||
char **new_hostname)
|
||||
{
|
||||
*new_hostname = strdup (orig_hostname);
|
||||
if (*new_hostname == NULL)
|
||||
if (*new_hostname == NULL) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
strlwr (*new_hostname);
|
||||
return 0;
|
||||
}
|
||||
@@ -70,10 +72,12 @@ krb5_expand_hostname (krb5_context context,
|
||||
if (a->ai_canonname != NULL) {
|
||||
*new_hostname = strdup (a->ai_canonname);
|
||||
freeaddrinfo (ai);
|
||||
if (*new_hostname == NULL)
|
||||
if (*new_hostname == NULL) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
freeaddrinfo (ai);
|
||||
|
Reference in New Issue
Block a user