Cleanups: s/ENOMEM/krb5_enomem(context)/

This commit is contained in:
Nicolas Williams
2011-10-20 12:38:32 -05:00
parent 2f03603d6b
commit 9f5a43084c
3 changed files with 59 additions and 132 deletions

View File

@@ -153,11 +153,8 @@ krb5_kt_register(krb5_context context,
tmp = realloc(context->kt_types,
(context->num_kt_types + 1) * sizeof(*context->kt_types));
if(tmp == NULL) {
krb5_set_error_message(context, ENOMEM,
N_("malloc: out of memory", ""));
return ENOMEM;
}
if(tmp == NULL)
return krb5_enomem(context);
memcpy(&tmp[context->num_kt_types], ops,
sizeof(tmp[context->num_kt_types]));
context->kt_types = tmp;
@@ -232,10 +229,8 @@ krb5_kt_resolve(krb5_context context,
}
k = malloc (sizeof(*k));
if (k == NULL) {
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
return ENOMEM;
}
if (k == NULL)
return krb5_enomem(context);
memcpy(k, &context->kt_types[i], sizeof(*k));
k->data = NULL;
ret = (*k->resolve)(context, residual, k);
@@ -449,9 +444,8 @@ krb5_kt_get_full_name(krb5_context context,
return ret;
if (asprintf(str, "%s:%s", type, name) == -1) {
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
*str = NULL;
return ENOMEM;
return krb5_enomem(context);
}
return 0;