[asterisk-commits] coreyfarrell: branch 11 r424569 - /branches/11/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 4 19:21:52 CDT 2014


Author: coreyfarrell
Date: Sat Oct  4 19:21:48 2014
New Revision: 424569

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424569
Log:
chan_sip: Clean leak on error path of process_sdp

Resolve leak in process_sdp that occurs in 2 error path's where
crypto lines are expected but not provided.

ASTERISK-24385 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4045/

Modified:
    branches/11/channels/chan_sip.c

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=424569&r1=424568&r2=424569
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Sat Oct  4 19:21:48 2014
@@ -10377,10 +10377,12 @@
 		/* Ensure crypto lines are provided where necessary */
 		if (audio && secure_audio && !processed_crypto) {
 			ast_log(LOG_WARNING, "Rejecting secure audio stream without encryption details: %s\n", m);
-			return -1;
+			res = -1;
+			goto process_sdp_cleanup_b;
 		} else if (video && secure_video && !processed_crypto) {
 			ast_log(LOG_WARNING, "Rejecting secure video stream without encryption details: %s\n", m);
-			return -1;
+			res = -1;
+			goto process_sdp_cleanup_b;
 		}
 	}
 
@@ -10689,6 +10691,8 @@
 	if (res) {
 		offered_media_list_destroy(p);
 	}
+
+process_sdp_cleanup_b:
 	ast_rtp_codecs_payloads_destroy(&newtextrtp);
 	ast_rtp_codecs_payloads_destroy(&newvideortp);
 	ast_rtp_codecs_payloads_destroy(&newaudiortp);




More information about the asterisk-commits mailing list