Skip to content
Snippets Groups Projects
Commit d4b69a2f authored by Jeremy McNamara's avatar Jeremy McNamara
Browse files

prevent deadlock if no config file

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent d0a7e585
No related branches found
No related tags found
No related merge requests found
......@@ -241,7 +241,7 @@ static int odbc_unload_module(void)
static int odbc_load_module(void)
{
int res;
int res = 0;
struct ast_config *cfg;
struct ast_variable *var;
char *tmp;
......@@ -252,13 +252,13 @@ static int odbc_load_module(void)
if (!cfg)
{
ast_log(LOG_WARNING, "cdr_odbc: Unable to load config for ODBC CDR's: %s\n", config);
return 0;
goto out;
}
var = ast_variable_browse(cfg, "global");
if (!var) {
/* nothing configured */
return 0;
goto out;
}
tmp = ast_variable_retrieve(cfg,"global","dsn");
......@@ -368,6 +368,7 @@ static int odbc_load_module(void)
{
ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
}
out:
ast_mutex_unlock(&odbc_lock);
return res;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment