mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
Fix crash when getting CEL config
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1512,7 +1512,7 @@ struct ast_cel_general_config *ast_cel_get_config(void)
|
|||||||
{
|
{
|
||||||
RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
|
RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
|
||||||
|
|
||||||
if (!mod_cfg->general) {
|
if (!mod_cfg || !mod_cfg->general) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1525,11 +1525,13 @@ void ast_cel_set_config(struct ast_cel_general_config *config)
|
|||||||
RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
|
RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
|
||||||
RAII_VAR(struct ast_cel_general_config *, cleanup_config, mod_cfg->general, ao2_cleanup);
|
RAII_VAR(struct ast_cel_general_config *, cleanup_config, mod_cfg->general, ao2_cleanup);
|
||||||
|
|
||||||
|
if (mod_cfg) {
|
||||||
mod_cfg->general = config;
|
mod_cfg->general = config;
|
||||||
if (mod_cfg->general) {
|
if (mod_cfg->general) {
|
||||||
ao2_ref(mod_cfg->general, +1);
|
ao2_ref(mod_cfg->general, +1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int ast_cel_backend_unregister(const char *name)
|
int ast_cel_backend_unregister(const char *name)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user