[asterisk-commits] gtjoseph: branch 13 r429719 - /branches/13/res/res_pjsip_config_wizard.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 17 18:10:54 CST 2014


Author: gtjoseph
Date: Wed Dec 17 18:10:51 2014
New Revision: 429719

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=429719
Log:
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


Modified:
    branches/13/res/res_pjsip_config_wizard.c

Modified: branches/13/res/res_pjsip_config_wizard.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_config_wizard.c?view=diff&rev=429719&r1=429718&r2=429719
==============================================================================
--- branches/13/res/res_pjsip_config_wizard.c (original)
+++ branches/13/res/res_pjsip_config_wizard.c Wed Dec 17 18:10:51 2014
@@ -983,12 +983,13 @@
 			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);
-		}
-
-		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);
+		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);
+		}
 	}
 
 	AST_VECTOR_REMOVE_CMP_UNORDERED(&object_type_wizards, NULL, NOT_EQUALS, OTW_DELETE_CB);




More information about the asterisk-commits mailing list