From fb87cc02f9af550c7ae1ef28e1894bdb03075205 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 10 Jun 2008 13:34:27 +0000 Subject: [PATCH] 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 --- channels/chan_sip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }