From: Joshua Colp Date: Mon, 24 Jun 2019 10:08:06 +0000 (+0000) Subject: res_pjsip_sdp_rtp: Fix ICE candidates leak. X-Git-Tag: 13.28.0-rc1~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9721f3908d4c4e36954b98f826dce7d98d7cf616;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 7c7040e35b..cc53913786 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -527,11 +527,7 @@ static void add_ice_to_stream(struct ast_sip_session *session, struct ast_sip_se 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; }