[Asterisk-code-review] res_pjsip_sdp_rtp: Fix ICE candidates leak. (...asterisk[13])

George Joseph asteriskteam at digium.com
Tue Jun 25 09:05:39 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11489 )

Change subject: res_pjsip_sdp_rtp: Fix ICE candidates leak.
......................................................................

res_pjsip_sdp_rtp: Fix ICE candidates leak.

Given the non-default configuration of enabling ICE support on an
endpoint that does not result in an ICE negotiation occurring the
ICE candidates would be leaked.

This change makes it so that the ICE candidates are only retrieved
if ICE negotiation is occurring.

ASTERISK-28460

Change-Id: I7b3f76f031c41fb8a3dc3ef1a84b77e2a8cb969f
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 1 insertion(+), 5 deletions(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 7c7040e..cc53913 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -527,11 +527,7 @@
 	struct ast_rtp_engine_ice_candidate *candidate;
 
 	if (!session->endpoint->media.rtp.ice_support || !(ice = ast_rtp_instance_get_ice(session_media->rtp)) ||
-		!(candidates = ice->get_local_candidates(session_media->rtp))) {
-		return;
-	}
-
-	if (!session_media->remote_ice) {
+		!session_media->remote_ice || !(candidates = ice->get_local_candidates(session_media->rtp))) {
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11489
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I7b3f76f031c41fb8a3dc3ef1a84b77e2a8cb969f
Gerrit-Change-Number: 11489
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190625/7d4188ea/attachment.html>


More information about the asterisk-code-review mailing list