[asterisk-commits] mmichelson: branch 1.4 r202572 - /branches/1.4/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 23 10:08:31 CDT 2009


Author: mmichelson
Date: Tue Jun 23 10:08:27 2009
New Revision: 202572

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202572
Log:
Fix potential memory leak in chan_sip when video rtp is not allocated properly.


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=202572&r1=202571&r2=202572
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Tue Jun 23 10:08:27 2009
@@ -4600,6 +4600,10 @@
 		if (!p->rtp || (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) && !p->vrtp)) {
 			ast_log(LOG_WARNING, "Unable to create RTP audio %s session: %s\n",
 				ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) ? "and video" : "", strerror(errno));
+			/* If rtp was successfully allocated, but vrtp was not, then we need to be sure to free rtp here */
+			if (p->rtp) {
+				ast_rtp_destroy(p->rtp);
+			}
 			ast_mutex_destroy(&p->lock);
 			if (p->chanvars) {
 				ast_variables_destroy(p->chanvars);




More information about the asterisk-commits mailing list