[asterisk-commits] kmoore: branch 10 r363987 - in /branches/10: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 26 08:27:41 CDT 2012
Author: kmoore
Date: Thu Apr 26 08:27:34 2012
New Revision: 363987
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363987
Log:
Fix reference leaks involving SIP Replaces transfers
The reference held for SIP blind transfers using the Replaces header in an
INVITE was never freed on success and also failed to be freed in some error
conditions. This caused a file descriptor leak since the RTP structures in use
at the time of the transfer were never freed. This reference leak and another
relating to subscriptions in the same code path have now been corrected.
(closes issue ASTERISK-19579)
........
Merged revisions 363986 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/10/ (props changed)
branches/10/channels/chan_sip.c
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=363987&r1=363986&r2=363987
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Thu Apr 26 08:27:34 2012
@@ -5841,8 +5841,12 @@
}
if (p->udptl)
ast_udptl_destroy(p->udptl);
- if (p->refer)
+ if (p->refer) {
+ if (p->refer->refer_call) {
+ p->refer->refer_call = dialog_unref(p->refer->refer_call, "unref dialog p->refer->refer_call");
+ }
ast_free(p->refer);
+ }
if (p->route) {
free_old_route(p->route);
p->route = NULL;
@@ -23096,6 +23100,7 @@
if (subscription->owner) {
ast_channel_unlock(subscription->owner);
}
+ subscription = dialog_unref(subscription, "unref dialog subscription");
}
}
@@ -23114,7 +23119,6 @@
if (p->refer->refer_call == p) {
ast_log(LOG_NOTICE, "INVITE with replaces into it's own call id (%s == %s)!\n", replace_id, p->callid);
- p->refer->refer_call = dialog_unref(p->refer->refer_call, "unref dialog p->refer->refer_call");
transmit_response_reliable(p, "400 Bad request", req); /* The best way to not not accept the transfer */
error = 1;
}
@@ -23142,6 +23146,7 @@
if (p->refer->refer_call->owner) {
ast_channel_unlock(p->refer->refer_call->owner);
}
+ p->refer->refer_call = dialog_unref(p->refer->refer_call, "unref dialog p->refer->refer_call");
}
refer_locked = 0;
p->invitestate = INV_COMPLETED;
More information about the asterisk-commits
mailing list