Merge "res_config_sqlite3: Fix crash when loading with invalid config"
authorzuul <zuul@gerrit.asterisk.org>
Sun, 19 Feb 2017 19:24:44 +0000 (13:24 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Sun, 19 Feb 2017 19:24:44 +0000 (13:24 -0600)
res/res_config_sqlite3.c

index b5c70ec..f2a6b00 100644 (file)
@@ -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;