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
This commit is contained in:
Kinsey Moore
2012-08-15 20:14:18 +00:00
parent af74988006
commit 01780bfda2

View File

@@ -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");