catch error from asprintf()

Patch from Tom Payerle
This commit is contained in:
Love Hornquist Astrand
2011-04-23 19:31:43 -07:00
parent 3b2e927c79
commit 311b3c4f32

View File

@@ -141,9 +141,11 @@ check_acl (krb5_context context, const char *name)
FILE *fp; FILE *fp;
char buf[256]; char buf[256];
int ret = 1; int ret = 1;
char *slavefile; char *slavefile = NULL;
asprintf(&slavefile, "%s/slaves", hdb_db_dir(context)); if (asprintf(&slavefile, "%s/slaves", hdb_db_dir(context))
|| slavefile == NULL)
errx(1, "out of memory");
fn = krb5_config_get_string_default(context, fn = krb5_config_get_string_default(context,
NULL, NULL,