[asterisk-commits] main/bridge channel: Fix channel reference leak on video source (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 7 16:04:26 CST 2016


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4306 )

Change subject: main/bridge_channel: Fix channel reference leak on video source
......................................................................


main/bridge_channel: Fix channel reference leak on video source

When a channel is made the video source, the bridge holds a reference to
it. Whenever the video source changes, that reference is released.
However, a ref leak does occur if the channel leaves the bridge (such as
being hung up) while it is the video source, as the bridge never
releases the ref in such a case.

This patch adds a line to the bridge_channel_internal_join routine such
that, when a channel finishes its time in the bridge, it notifies the
bridge via ast_bridge_remove_video_src that if it is a video source its
reference should be released.

ASTERISK-26555 #close

Change-Id: I3a2f5238a9d2fc49c591f0e65199d782ab0be76a
---
M main/bridge_channel.c
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 18f7195..2142ae7 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -2772,6 +2772,9 @@
 	bridge_channel_settle_owed_events(bridge_channel->bridge, bridge_channel);
 	bridge_reconfigured(bridge_channel->bridge, 1);
 
+	/* Remove ourselves if we are the video source */
+	ast_bridge_remove_video_src(bridge_channel->bridge, bridge_channel->chan);
+
 	ast_bridge_unlock(bridge_channel->bridge);
 
 	/* Must release any swap ref after unlocking the bridge. */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a2f5238a9d2fc49c591f0e65199d782ab0be76a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list