]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res/res_pjsip_sdp_rtp: Fix leak of local ICE candidates when applying to SDP
authorMatthew Jordan <mjordan@digium.com>
Sun, 8 Feb 2015 17:24:01 +0000 (17:24 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 8 Feb 2015 17:24:01 +0000 (17:24 +0000)
When an SDP is created for an outgoing request/response, the ICE candidates
obtained from the RTP instance are currently leaked. This causes the ao2
container that holds the candidates to never properly be reclaimed when the
RTP instance is destroyed.

This patch properly decrements the ICE candidates' container if it is
successfully obtained.

ASTERISK-24769 #close
Reported by: Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431600 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip_sdp_rtp.c

index fb194c54e90f721d2cd22688112a87b8978edf61..6471341b333cb8758cadea4855ea1591a6130277 100644 (file)
@@ -396,6 +396,7 @@ static void add_ice_to_stream(struct ast_sip_session *session, struct ast_sip_se
        }
 
        ao2_iterator_destroy(&it_candidates);
+       ao2_ref(candidates, -1);
 }
 
 /*! \brief Function which processes ICE attributes in an audio stream */