From: Kinsey Moore Date: Wed, 15 Aug 2012 20:14:18 +0000 (+0000) Subject: Avoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction X-Git-Tag: 1.8.17.0-rc1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01780bfda2b45d734c8a1579e874953fa4a764ed;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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@371270 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a8a463c149..06284febec 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5819,7 +5819,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");