]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: sip_subscribe_mwi_destroy should not call sip_destroy
authorCorey Farrell <git@cfware.com>
Thu, 24 Jul 2014 17:55:48 +0000 (17:55 +0000)
committerCorey Farrell <git@cfware.com>
Thu, 24 Jul 2014 17:55:48 +0000 (17:55 +0000)
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@419440 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index ae2b0df6280490ddbd505ae62dc6ee9f09a1138e..e897a7e641830265544bfab07339fbfeb288489e 100644 (file)
@@ -6108,9 +6108,9 @@ 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);
        ast_string_field_free_memory(mwi);
        ast_free(mwi);