From: Marko Kreen Date: Sun, 20 Mar 2011 21:10:40 +0000 (+0200) Subject: When first config load fails, exit. X-Git-Tag: pgbouncer_1_4_1_rc2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85f621b13c509ea12f468710397bc0911780ccce;p=pgbouncer When first config load fails, exit. Otherwise we may crash on uninitialized values. --- diff --git a/src/main.c b/src/main.c index 834dd2f..7ea84e7 100644 --- a/src/main.c +++ b/src/main.c @@ -280,6 +280,7 @@ static void set_dbs_dead(bool flag) /* config loading, tries to be tolerant to errors */ void load_config(void) { + static bool loaded = false; bool ok; set_dbs_dead(true); @@ -290,6 +291,9 @@ void load_config(void) /* load users if needed */ if (cf_auth_type >= AUTH_TRUST) load_auth_file(cf_auth_file); + loaded = true; + } else if (!loaded) { + die("Cannot load config file"); } else { log_warning("Config file loading failed"); /* if ini file missing, dont kill anybody */