catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 13:28:49 -07:00
parent 351e0d0914
commit 788189805c
9 changed files with 49 additions and 33 deletions

View File

@@ -1028,11 +1028,11 @@ acc_get_default_name(krb5_context context, char **str)
return translate_cc_error(context, error);
}
asprintf(str, "API:%s", name->data);
error = asprintf(str, "API:%s", name->data);
(*name->func->release)(name);
(*cc->func->release)(cc);
if (*str == NULL) {
if (error < 0 || *str == NULL) {
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
return ENOMEM;
}