From 311b3c4f32f84c97d4268364827d4057e784a83c Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sat, 23 Apr 2011 19:31:43 -0700 Subject: [PATCH] catch error from asprintf() Patch from Tom Payerle --- lib/kadm5/ipropd_master.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/kadm5/ipropd_master.c b/lib/kadm5/ipropd_master.c index c5e0ffd84..16ac5f480 100644 --- a/lib/kadm5/ipropd_master.c +++ b/lib/kadm5/ipropd_master.c @@ -141,9 +141,11 @@ check_acl (krb5_context context, const char *name) FILE *fp; char buf[256]; 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, NULL,