From 50044fdc15197b3a4a742827c97fc25daddc98aa Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 22 May 2015 22:50:43 -0400 Subject: Stasis: Fix unsafe use of stasis_unsubscribe in modules. Many uses of stasis_unsubscribe in modules can be reached through unload. These have been switched to stasis_unsubscribe_and_join. Some subscription callbacks do nothing, for these I've created a noop callback function in stasis.c. This is used by some modules that monitor MWI topics in order to enable cache, since the callback does not become invalid after dlclose it is safe to use stasis_unsubscribe on these, even during module unload. ASTERISK-25121 #close Change-Id: Ifc2549fbd8eef7d703c222978e8f452e2972189c --- channels/chan_skinny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'channels/chan_skinny.c') diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 47c7352c6..03da0e0d8 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -8756,7 +8756,7 @@ static int unload_module(void) skinny_unlocksub(sub); } if (l->mwi_event_sub) { - l->mwi_event_sub = stasis_unsubscribe(l->mwi_event_sub); + l->mwi_event_sub = stasis_unsubscribe_and_join(l->mwi_event_sub); } ast_mutex_unlock(&l->lock); unregister_exten(l); -- cgit v1.2.3