[svn-commits] file: branch file/pimp_sip_media r380906 - /team/file/pimp_sip_media/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 5 13:20:59 CST 2013


Author: file
Date: Tue Feb  5 13:20:56 2013
New Revision: 380906

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380906
Log:
Fix a memory leak where the resolved SDP connection details were not freed and error out SDP negotiation if IPv6 is configured to be on but the offer does not include it.

Modified:
    team/file/pimp_sip_media/res/res_sip_sdp_audio.c

Modified: team/file/pimp_sip_media/res/res_sip_sdp_audio.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_media/res/res_sip_sdp_audio.c?view=diff&rev=380906&r1=380905&r2=380906
==============================================================================
--- team/file/pimp_sip_media/res/res_sip_sdp_audio.c (original)
+++ team/file/pimp_sip_media/res/res_sip_sdp_audio.c Tue Feb  5 13:20:56 2013
@@ -100,7 +100,7 @@
 {
 	int addrs_cnt;
 	char host[NI_MAXHOST];
-	struct ast_sockaddr *addrs;
+	RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free);
 
 	/* If no audio formats have been configured reject this stream */
 	if (!ast_format_cap_has_type(session->endpoint->codecs, AST_FORMAT_TYPE_AUDIO)) {
@@ -116,6 +116,11 @@
 	/* Ensure that the address provided is valid */
 	if ((addrs_cnt = ast_sockaddr_resolve(&addrs, host, PARSE_PORT_FORBID, AST_AF_UNSPEC)) <= 0) {
 		/* The provided host was actually invalid so we error out this negotiation */
+		return -1;
+	}
+
+	/* If IPv6 is configured but the media stream does not have it reject this stream */
+	if (session->rtp_ipv6 && !ast_sockaddr_is_ipv6(addrs)) {
 		return -1;
 	}
 




More information about the svn-commits mailing list