From: Kinsey Moore Date: Wed, 15 Aug 2012 20:15:08 +0000 (+0000) Subject: Avoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction X-Git-Tag: 10.9.0-rc1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64eaf61c3621954666a4dc7577c47ffd84755f9d;p=thirdparty%2Fasterisk.git Avoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction The other instance of this bug was fixed by jcolp/file in r121496. If we are destroying a dialog only set the MWI dialog pointer on the related peer to NULL if it is the dialog currently being destroyed. (closes issue ASTERISK-20119) Patch-by: Misha Vodsedalek ........ Merged revisions 371270 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@371271 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 3de2930ddc..1611e4cba9 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5852,7 +5852,7 @@ void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist) } /* Remove link from peer to subscription of MWI */ - if (p->relatedpeer && p->relatedpeer->mwipvt) + if (p->relatedpeer && p->relatedpeer->mwipvt == p) p->relatedpeer->mwipvt = dialog_unref(p->relatedpeer->mwipvt, "delete ->relatedpeer->mwipvt"); if (p->relatedpeer && p->relatedpeer->call == p) p->relatedpeer->call = dialog_unref(p->relatedpeer->call, "unset the relatedpeer->call field in tandem with relatedpeer field itself");