Use krb5_enomem() more consistently in lib/krb5.
This commit is contained in:
@@ -62,8 +62,7 @@ make_etypelist(krb5_context context,
|
||||
ALLOC_SEQ(&ad, 1);
|
||||
if (ad.val == NULL) {
|
||||
free(buf);
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
return krb5_enomem(context);
|
||||
}
|
||||
|
||||
ad.val[0].ad_type = KRB5_AUTHDATA_GSS_API_ETYPE_NEGOTIATION;
|
||||
@@ -82,16 +81,14 @@ make_etypelist(krb5_context context,
|
||||
ALLOC(*auth_data, 1);
|
||||
if (*auth_data == NULL) {
|
||||
free(buf);
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
return krb5_enomem(context);
|
||||
}
|
||||
|
||||
ALLOC_SEQ(*auth_data, 1);
|
||||
if ((*auth_data)->val == NULL) {
|
||||
free(*auth_data);
|
||||
free(buf);
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
return krb5_enomem(context);
|
||||
}
|
||||
|
||||
(*auth_data)->val[0].ad_type = KRB5_AUTHDATA_IF_RELEVANT;
|
||||
@@ -136,7 +133,7 @@ _krb5_build_authenticator (krb5_context context,
|
||||
&auth_context->local_seqnumber);
|
||||
ALLOC(auth.seq_number, 1);
|
||||
if(auth.seq_number == NULL) {
|
||||
ret = ENOMEM;
|
||||
ret = krb5_enomem(context);
|
||||
goto fail;
|
||||
}
|
||||
*auth.seq_number = auth_context->local_seqnumber;
|
||||
@@ -147,7 +144,7 @@ _krb5_build_authenticator (krb5_context context,
|
||||
if (cksum) {
|
||||
ALLOC(auth.cksum, 1);
|
||||
if (auth.cksum == NULL) {
|
||||
ret = ENOMEM;
|
||||
ret = krb5_enomem(context);
|
||||
goto fail;
|
||||
}
|
||||
ret = copy_Checksum(cksum, auth.cksum);
|
||||
|
||||
Reference in New Issue
Block a user