Use krb5_enomem() more consistently in lib/krb5.

This commit is contained in:
Roland C. Dowdeswell
2013-02-13 16:15:00 +08:00
parent edae63418e
commit f0f07ff408
62 changed files with 393 additions and 837 deletions

View File

@@ -63,15 +63,14 @@ any_resolve(krb5_context context, const char *name, krb5_keytab id)
while (strsep_copy(&name, ",", buf, sizeof(buf)) != -1) {
a = calloc(1, sizeof(*a));
if (a == NULL) {
ret = ENOMEM;
ret = krb5_enomem(context);
goto fail;
}
if (a0 == NULL) {
a0 = a;
a->name = strdup(buf);
if (a->name == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, N_("malloc: out of memory", ""));
ret = krb5_enomem(context);
goto fail;
}
} else
@@ -131,10 +130,8 @@ any_start_seq_get(krb5_context context,
krb5_error_code ret;
c->data = malloc (sizeof(struct any_cursor_extra_data));
if(c->data == NULL){
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
return ENOMEM;
}
if(c->data == NULL)
return krb5_enomem(context);
ed = (struct any_cursor_extra_data *)c->data;
for (ed->a = a; ed->a != NULL; ed->a = ed->a->next) {
ret = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor);