Prevent crash from using app_page with no confbridge.conf file provided.

Also prevents other potential crashes when using aco API
with uninitialized aco_info structs.

(closes issue ASTERISK-20305)
reported by Noah Engelberth
Tested by Noah Engelberth

Review: https://reviewboard.asterisk.org/r/2086
........

Merged revisions 372135 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-09-04 15:35:02 +00:00
parent e7ef469826
commit 1b6cf69e7b
2 changed files with 31 additions and 4 deletions

View File

@@ -2832,6 +2832,10 @@ static int load_module(void)
{
int res = 0;
if (conf_load_config(0)) {
ast_log(LOG_ERROR, "Unable to load config. Not loading module.\n");
return AST_MODULE_LOAD_DECLINE;
}
if ((ast_custom_function_register(&confbridge_function))) {
return AST_MODULE_LOAD_FAILURE;
}
@@ -2870,10 +2874,6 @@ static int load_module(void)
return AST_MODULE_LOAD_FAILURE;
}
if (conf_load_config(0)) {
ast_log(LOG_ERROR, "Unable to load config. Not loading module.\n");
return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;
}