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

@@ -226,17 +226,18 @@ load_plugins(krb5_context context)
continue;
path = NULL;
ret = 0;
#ifdef __APPLE__
{ /* support loading bundles on MacOS */
size_t len = strlen(n);
if (len > 7 && strcmp(&n[len - 7], ".bundle") == 0)
asprintf(&path, "%s/%s/Contents/MacOS/%.*s", *di, n, (int)(len - 7), n);
ret = asprintf(&path, "%s/%s/Contents/MacOS/%.*s", *di, n, (int)(len - 7), n);
}
#endif
if (path == NULL)
asprintf(&path, "%s/%s", *di, n);
if (ret < 0 || path == NULL)
ret = asprintf(&path, "%s/%s", *di, n);
if (path == NULL) {
if (ret < 0 || path == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
return ret;