Use krb5_enomem() more consistently in lib/krb5.
This commit is contained in:
@@ -50,10 +50,8 @@ DES3_string_to_key(krb5_context context,
|
||||
|
||||
len = password.length + salt.saltvalue.length;
|
||||
str = malloc(len);
|
||||
if(len != 0 && str == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
if (len != 0 && str == NULL)
|
||||
return krb5_enomem(context);
|
||||
memcpy(str, password.data, password.length);
|
||||
memcpy(str + password.length, salt.saltvalue.data, salt.saltvalue.length);
|
||||
{
|
||||
@@ -112,10 +110,8 @@ DES3_string_to_key_derived(krb5_context context,
|
||||
char *s;
|
||||
|
||||
s = malloc(len);
|
||||
if(len != 0 && s == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
if (len != 0 && s == NULL)
|
||||
return krb5_enomem(context);
|
||||
memcpy(s, password.data, password.length);
|
||||
memcpy(s + password.length, salt.saltvalue.data, salt.saltvalue.length);
|
||||
ret = krb5_string_to_key_derived(context,
|
||||
|
Reference in New Issue
Block a user