From: Sean Bright Date: Wed, 15 Feb 2017 17:55:19 +0000 (-0500) Subject: res_config_sqlite3: Fix crash when loading with invalid config X-Git-Tag: 13.15.0-rc1~79^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b7c6678aedfe9cb196442b9170870d5ac352402;p=thirdparty%2Fasterisk.git res_config_sqlite3: Fix crash when loading with invalid config When ast_config_load() fails with CONFIG_STATUS_FILEINVALID, it has already destroyed the ast_config struct for us. Trying to do it again results in a crash. Change-Id: If6a5c0ca718ad428e01a1fb25beb209a9ac18bc6 --- diff --git a/res/res_config_sqlite3.c b/res/res_config_sqlite3.c index 4c4b820516..39d4f08ad5 100644 --- a/res/res_config_sqlite3.c +++ b/res/res_config_sqlite3.c @@ -1127,6 +1127,8 @@ static int parse_config(int reload) if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEINVALID) { ast_log(LOG_ERROR, "%s config file '%s'\n", config == CONFIG_STATUS_FILEMISSING ? "Missing" : "Invalid", config_filename); + ast_mutex_unlock(&config_lock); + return 0; } else { const char *cat; struct realtime_sqlite3_db *db;