aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-11 19:35:37 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-11 19:35:37 +0000
commitb238aede15f7b6994348e3fc14aad57725830b35 (patch)
treeb17c5c01d4e783f8d539b298d9e2acb62076406b /channels/chan_sip.c
parent01c9b882601830b18c2b9fe4597f31d4959214c0 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@262418 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1f16d6b09..54be4895e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3345,10 +3345,13 @@ static int send_provisional_keepalive_with_sdp(const void *data) {
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 @@ static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmitty
/* 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 @@ static int __sip_destroy(struct sip_pvt *p, int lockowner)
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) {