summaryrefslogtreecommitdiff
path: root/main/bridge_channel.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-11-04 15:37:57 -0500
committerMatt Jordan <mjordan@digium.com>2016-11-04 15:50:41 -0500
commitbbe943729a5f627b31f1ae5e3ed303896c5ecf0f (patch)
tree81780887ba99778d4c6ac1f52bc137ae2e20273c /main/bridge_channel.c
parentbf01ff53f8d93d637981720331405e56f0b3b118 (diff)
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
Diffstat (limited to 'main/bridge_channel.c')
-rw-r--r--main/bridge_channel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 722fc6687..7f3c8fe31 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -2770,6 +2770,9 @@ int bridge_channel_internal_join(struct ast_bridge_channel *bridge_channel)
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. */