From: Joshua Colp Date: Tue, 10 Jun 2008 13:34:27 +0000 (+0000) Subject: If we are destroying a dialog only set the MWI dialog pointer on the related peer... X-Git-Tag: 1.4.22-rc1~228 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb87cc02f9af550c7ae1ef28e1894bdb03075205;p=thirdparty%2Fasterisk.git 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 #12828) Reported by: ramonpeek git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121495 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2838110cee..912fe9a5ec 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3115,7 +3115,9 @@ static int __sip_destroy(struct sip_pvt *p, int lockowner) /* Remove link from peer to subscription of MWI */ if (p->relatedpeer) { - p->relatedpeer->mwipvt = NULL; + if (p->relatedpeer->mwipvt == p) { + p->relatedpeer->mwipvt = NULL; + } ASTOBJ_UNREF(p->relatedpeer, sip_destroy_peer); }