summaryrefslogtreecommitdiff
path: root/res/res_config_sqlite3.c
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-02-15 12:55:19 -0500
committerSean Bright <sean.bright@gmail.com>2017-02-18 12:19:37 -0600
commit44abe214d24f772b9d66a96d592aa15c17c7c429 (patch)
tree250d452eb27c9956bf5d913b440005e3c8df6c20 /res/res_config_sqlite3.c
parentc227745bc7874d101cd03508eb5e177b757e5fe4 (diff)
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
Diffstat (limited to 'res/res_config_sqlite3.c')
-rw-r--r--res/res_config_sqlite3.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_config_sqlite3.c b/res/res_config_sqlite3.c
index b5c70ec2d..f2a6b00db 100644
--- a/res/res_config_sqlite3.c
+++ b/res/res_config_sqlite3.c
@@ -1125,6 +1125,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;