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

@@ -447,8 +447,9 @@ krb5_config_parse_file_multi (krb5_context context,
fname = newfname;
}
#else /* KRB5_USE_PATH_TOKENS */
asprintf(&newfname, "%%{USERCONFIG}%s", &fname[1]);
if (newfname == NULL) {
if (asprintf(&newfname, "%%{USERCONFIG}%s", &fname[1]) < 0 ||
newfname == NULL)
{
krb5_set_error_message(context, ENOMEM,
N_("malloc: out of memory", ""));
return ENOMEM;