Merged revisions 45928 via svnmerge from
[asterisk/asterisk.git] / cdr / cdr_odbc.c
index f916a8d..79ea145 100644 (file)
@@ -346,7 +346,6 @@ static int odbc_load_module(void)
                goto out;
        }
 
                goto out;
        }
 
-       ast_config_destroy(cfg);
        if (option_verbose > 2) {
                ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: dsn is %s\n",dsn);
                if (username)
        if (option_verbose > 2) {
                ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: dsn is %s\n",dsn);
                if (username)
@@ -371,6 +370,8 @@ static int odbc_load_module(void)
                ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
        }
 out:
                ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
        }
 out:
+       if (cfg)
+               ast_config_destroy(cfg);
        ast_mutex_unlock(&odbc_lock);
        return res;
 }
        ast_mutex_unlock(&odbc_lock);
        return res;
 }