summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_registration.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-06-15 15:28:41 -0500
committerRichard Mudgett <rmudgett@digium.com>2015-06-25 14:36:12 -0500
commit8c6a95a9ac605c53d1a5863528ff940221684ea3 (patch)
tree2f97e8aa7b1912fab4725fad435b6adca67a2e8e /res/res_pjsip_outbound_registration.c
parent20f3d77ab9cfa7f16c7d34956c660d302a71bc53 (diff)
res_pjsip_outbound_registration.c: Use ast_sorcery_object_unregister() API
The sorcery pjsip 'registration' config object needs to be destroyed on module unload. Otherwise, a reload of res_pjsip could try to use callbacks for a previously unloaded instance of the module provided by ast_sorcery_object_register() or one of the variants. Also, if res_pjsip_outbound_registration were subsequently reloaded, the sorcery config field objects would be registered in sorcery twice. ASTERISK-24907 Reported by: Kevin Harwell Change-Id: I304fad13dece2604af48353f6c6d9d5c7b064697
Diffstat (limited to 'res/res_pjsip_outbound_registration.c')
-rw-r--r--res/res_pjsip_outbound_registration.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 78b863f49..27e79bd89 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1775,6 +1775,8 @@ static int unload_module(void)
ast_sorcery_observer_remove(ast_sip_get_sorcery(), "auth", &observer_callbacks_auth);
ast_sorcery_instance_observer_remove(ast_sip_get_sorcery(), &observer_callbacks_registrations);
+ ast_sorcery_object_unregister(ast_sip_get_sorcery(), "registration");
+
ao2_global_obj_release(current_states);
return 0;