[asterisk-commits] tilghman: branch 1.6.0 r262418 - /branches/1.6.0/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 11 14:35:50 CDT 2010


Author: tilghman
Date: Tue May 11 14:35:37 2010
New Revision: 262418

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=262418
Log:
Backport fix for issue #16774 to 1.6.0 (refcount leak with provisional responses)

(closes issue #16202)
 Reported by: jsutton
 Patches: 
       20100504__issue16202.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman

Modified:
    branches/1.6.0/channels/chan_sip.c

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=262418&r1=262417&r2=262418
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue May 11 14:35:37 2010
@@ -3345,10 +3345,13 @@
 
 static void update_provisional_keepalive(struct sip_pvt *pvt, int with_sdp)
 {
-	AST_SCHED_DEL(sched, pvt->provisional_keepalive_sched_id);
+	AST_SCHED_DEL_UNREF(sched, pvt->provisional_keepalive_sched_id, dialog_unref(pvt));
 
 	pvt->provisional_keepalive_sched_id = ast_sched_add(sched, PROVIS_KEEPALIVE_TIMEOUT,
 		with_sdp ? send_provisional_keepalive_with_sdp : send_provisional_keepalive, pvt);
+	if (pvt->provisional_keepalive_sched_id > 0) {
+		dialog_ref(pvt);
+	}
 }
 
 /*! \brief Transmit response on SIP request*/
@@ -3374,7 +3377,7 @@
 
 	/* If we are sending a final response to an INVITE, stop retransmitting provisional responses */
 	if (p->initreq.method == SIP_INVITE && reliable == XMIT_CRITICAL) {
-		AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id);
+		AST_SCHED_DEL_UNREF(sched, p->provisional_keepalive_sched_id, dialog_unref(p));
 	}
 
 	res = (reliable) ?
@@ -4690,7 +4693,7 @@
 	AST_SCHED_DEL(sched, p->waitid);
 	AST_SCHED_DEL(sched, p->autokillid);
 	AST_SCHED_DEL(sched, p->request_queue_sched_id);
-	AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id);
+	AST_SCHED_DEL_UNREF(sched, p->provisional_keepalive_sched_id, dialog_unref(p));
 	AST_SCHED_DEL(sched, p->t38id);
 
 	if (p->rtp) {




More information about the asterisk-commits mailing list