From: Corey Farrell Date: Thu, 19 Mar 2015 09:44:03 +0000 (+0000) Subject: chan_sip: Fix dialog reference leaked to scheduler for reinvite_timeout. X-Git-Tag: 13.3.0-rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fddae99dd8f3f77245a5d9811734259a5f9e138;p=thirdparty%2Fasterisk.git chan_sip: Fix dialog reference leaked to scheduler for reinvite_timeout. Release the scheduler reference to the dialog for reinvite timeout during dialog_unlink_all. ASTERISK-24876 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4491/ ........ Merged revisions 433112 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433113 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9826f42a3b..83d6716f2e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3336,6 +3336,10 @@ void dialog_unlink_all(struct sip_pvt *dialog) AST_SCHED_DEL_UNREF(sched, dialog->initid, dialog_unref(dialog, "when you delete the initid sched, you should dec the refcount for the stored dialog ptr")); + if (dialog->reinviteid > -1) { + AST_SCHED_DEL_UNREF(sched, dialog->reinviteid, dialog_unref(dialog, "clear ref for reinvite_timeout")); + } + if (dialog->autokillid > -1) { AST_SCHED_DEL_UNREF(sched, dialog->autokillid, dialog_unref(dialog, "when you delete the autokillid sched, you should dec the refcount for the stored dialog ptr")); }