Use krb5_enomem() more consistently in lib/krb5.
This commit is contained in:
@@ -39,11 +39,8 @@ copy_hostname(krb5_context context,
|
||||
char **new_hostname)
|
||||
{
|
||||
*new_hostname = strdup (orig_hostname);
|
||||
if (*new_hostname == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
if (*new_hostname == NULL)
|
||||
return krb5_enomem(context);
|
||||
strlwr (*new_hostname);
|
||||
return 0;
|
||||
}
|
||||
@@ -84,13 +81,10 @@ krb5_expand_hostname (krb5_context context,
|
||||
if (a->ai_canonname != NULL) {
|
||||
*new_hostname = strdup (a->ai_canonname);
|
||||
freeaddrinfo (ai);
|
||||
if (*new_hostname == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM,
|
||||
N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
} else {
|
||||
if (*new_hostname == NULL)
|
||||
return krb5_enomem(context);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
freeaddrinfo (ai);
|
||||
|
Reference in New Issue
Block a user