From c1eb1b0712bf6a7d0b59ca0d1f7983d8eef781a5 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 24 Jul 2014 17:57:46 +0000 Subject: [PATCH] chan_sip: sip_subscribe_mwi_destroy should not call sip_destroy sip_subscribe_mwi_destroy calls sip_destroy on the reference counted mwi->call. This results in the fields of mwi->call being freed, but mwi->call itself it leaked. If other code is still using mwi->call it can cause problems. This change uses dialog_unref instead, to balance the ref provided by sip_alloc(). ASTERISK-24087 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3834/ ........ Merged revisions 419440 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 419441 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@419442 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 34c7dde4fe..204f2bcd48 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6575,7 +6575,7 @@ static void sip_subscribe_mwi_destroy(struct sip_subscription_mwi *mwi) { if (mwi->call) { mwi->call->mwi = NULL; - sip_destroy(mwi->call); + mwi->call = dialog_unref(mwi->call, "sip_subscription_mwi destruction"); } AST_SCHED_DEL(sched, mwi->resub); -- 2.47.2