Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon trying to parse an invalid config

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2008-11-19 19:25:14 +00:00
parent 3d8fb2d878
commit d66a8cd264
19 changed files with 31 additions and 21 deletions

View File

@@ -3510,7 +3510,7 @@ static struct chan_usbradio_pvt *store_config(struct ast_config *cfg, char *ctg)
o->txctcssadj = 200;
o->rxsquelchadj = 500;
o->devstr[0] = 0;
if (cfg1) {
if (cfg1 && cfg1 != CONFIG_STATUS_FILEINVALID) {
for (v = ast_variable_browse(cfg1, o->name); v; v = v->next) {
M_START((char *)v->name, (char *)v->value);
@@ -3942,9 +3942,9 @@ static int load_module(void)
/* load config file */
#ifdef NEW_ASTERISK
if (!(cfg = ast_config_load(config,zeroflag))) {
if (!(cfg = ast_config_load(config,zeroflag)) || cfg == CONFIG_STATUS_FILEINVALID) {
#else
if (!(cfg = ast_config_load(config))) {
if (!(cfg = ast_config_load(config))) || cfg == CONFIG_STATUS_FILEINVALID {
#endif
ast_log(LOG_NOTICE, "Unable to load config %s\n", config);
return AST_MODULE_LOAD_DECLINE;