[asterisk-commits] chan sip: Fix early call pickup channel leak. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 4 19:09:51 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: chan_sip: Fix early call pickup channel leak.
......................................................................


chan_sip: Fix early call pickup channel leak.

When handle_invite_replaces() was called, and either ast_bridge_impart()
failed or there was no bridge (because the channel we're picking up was
still ringing), chan_sip would leak a channel.

Thanks Matt and Corey for checking the bridge path.

ASTERISK-25226 #close

Change-Id: Ie736bb182170a73eef5bcef0ab0376f645c260c8
---
M channels/chan_sip.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 30cb20d..1838bda 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -24932,10 +24932,12 @@
 		if (ast_bridge_impart(bridge, c, replaces_chan, NULL,
 			AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
 			ast_hangup(c);
+			ast_channel_unref(c);
 		}
 	} else {
 		ast_channel_move(replaces_chan, c);
 		ast_hangup(c);
+		ast_channel_unref(c);
 	}
 	sip_pvt_lock(p);
 	return 0;

-- 
To view, visit https://gerrit.asterisk.org/774
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie736bb182170a73eef5bcef0ab0376f645c260c8
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list