catch error from asprintf()

This commit is contained in:
Love Hornquist Astrand
2011-04-23 18:57:57 -07:00
parent 1b81d2db6b
commit 3b2e927c79

View File

@@ -528,8 +528,8 @@ main(int argc, char **argv)
setup_signal(); setup_signal();
if (config_file == NULL) { if (config_file == NULL) {
asprintf(&config_file, "%s/kdc.conf", hdb_db_dir(context)); if (asprintf(&config_file, "%s/kdc.conf", hdb_db_dir(context)) == -1
if (config_file == NULL) || config_file == NULL)
errx(1, "out of memory"); errx(1, "out of memory");
} }