mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
prevent deadlock if no config file
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user