[Asterisk-code-review] bridge: Old channel video source not set to NULL after unref. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Thu Dec 21 06:08:37 CST 2017


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

Change subject: bridge: Old channel video source not set to NULL after unref.
......................................................................

bridge: Old channel video source not set to NULL after unref.

The bridge holds onto the old channel video source after it's been
released.  This can lead to use after free errors.

ASTERISK-27229 #close

Change-Id: Ib2dab61677dd8a21f7ad53cdc9b8ca93297838b3
---
M main/bridge.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/main/bridge.c b/main/bridge.c
index 7a937ea..88d9e54 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -3848,7 +3848,7 @@
 		data->average_talking_energy = talker_energy;
 	} else if ((data->average_talking_energy < talker_energy) && is_keyframe) {
 		if (data->chan_old_vsrc) {
-			ast_channel_unref(data->chan_old_vsrc);
+			data->chan_old_vsrc = ast_channel_unref(data->chan_old_vsrc);
 		}
 		if (data->chan_vsrc) {
 			data->chan_old_vsrc = data->chan_vsrc;

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2dab61677dd8a21f7ad53cdc9b8ca93297838b3
Gerrit-Change-Number: 7677
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171221/d48751d4/attachment.html>


More information about the asterisk-code-review mailing list