diff options
author | George Joseph <george.joseph@fairview5.com> | 2014-12-18 00:10:51 +0000 |
---|---|---|
committer | George Joseph <george.joseph@fairview5.com> | 2014-12-18 00:10:51 +0000 |
commit | b4621cd0f538dc71a0418b57750a79e39ace2944 (patch) | |
tree | 0f2f05e352fbb4a89a91ae28601756e19911094c /res/res_pjsip_config_wizard.c | |
parent | 105f224cfd9a3651cb78f21e4f60b656013be488 (diff) |
res_pjsip_config_wizard: fix unload SEGV
If certain pjsip modules aren't loaded, the wizard causes a SEGV
when it unloads. Added a check for the presense of the object
type wizard before trying to clean it up.
Tested-by: George Joseph
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_config_wizard.c')
-rw-r--r-- | res/res_pjsip_config_wizard.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c index 86187ee3f..a7f2803d1 100644 --- a/res/res_pjsip_config_wizard.c +++ b/res/res_pjsip_config_wizard.c @@ -983,12 +983,13 @@ static int unload_module(void) ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, NULL, NULL), ao2_cleanup); otw = find_wizard(object_types[i]); - if (otw->sorcery) { - ast_sorcery_instance_observer_remove(otw->sorcery, &observer); + if (otw) { + if (otw->sorcery) { + ast_sorcery_instance_observer_remove(otw->sorcery, &observer); + } + otw->wizard->retrieve_multiple(otw->sorcery, otw->wizard_data, object_types[i], existing, NULL); + ao2_callback(existing, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, delete_existing_cb, otw); } - - otw->wizard->retrieve_multiple(otw->sorcery, otw->wizard_data, object_types[i], existing, NULL); - ao2_callback(existing, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, delete_existing_cb, otw); } AST_VECTOR_REMOVE_CMP_UNORDERED(&object_type_wizards, NULL, NOT_EQUALS, OTW_DELETE_CB); |