diff options
author | Corey Farrell <git@cfware.com> | 2015-05-22 22:50:43 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2015-05-22 22:58:32 -0400 |
commit | 0d266cbe025e30ce18121f43dbb6b11620b4d5e1 (patch) | |
tree | 3f215665d20602915427b42768fbcbdc1af47e67 /channels/chan_sip.c | |
parent | eaabc4d04c9c4ebca1a4d04b5e9e6a36cc0b764b (diff) |
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
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1307a9342..b1fbd6e9b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5004,7 +5004,7 @@ static void register_peer_exten(struct sip_peer *peer, int onoff) static void destroy_mailbox(struct sip_mailbox *mailbox) { if (mailbox->event_sub) { - mailbox->event_sub = stasis_unsubscribe(mailbox->event_sub); + mailbox->event_sub = stasis_unsubscribe_and_join(mailbox->event_sub); } ast_free(mailbox); } |