Fixed crash from orphaned MWI subscriptions in chan_sip
authorMatthew Jordan <mjordan@digium.com>
Tue, 6 Dec 2011 17:34:35 +0000 (17:34 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 6 Dec 2011 17:34:35 +0000 (17:34 +0000)
commitb8dba87a4c1af520c92f5183b7b516f006964861
tree15136997fbda468c43d5a88540d551fe62d95653
parent938b642245f6d8289400d413e3abcdb4d2ebafc4
Fixed crash from orphaned MWI subscriptions in chan_sip

This patch resolves the issue where MWI subscriptions are orphaned
by subsequent SIP SUBSCRIBE messages.  When a peer is removed, either
by pruning realtime SIP peers or by unloading / loading chan_sip, the
MWI subscriptions that were orphaned would still be on the event engine
list of valid subscriptions but have a pointer to a peer that no longer
was valid.  When an MWI event would occur, this would cause a seg fault.

(closes issue ASTERISK-18663)
Reported by: Ross Beer
Tested by: Ross Beer, Matt Jordan
Patches:
  blf_mwi_diff_12_06_11.txt uploaded by Matt Jordan (license 6283)

Review: https://reviewboard.asterisk.org/r/1610/
........

Merged revisions 347058 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 347068 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c