[svn-commits] seanbright: trunk r196381 - /trunk/channels/chan_gtalk.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 22 15:01:14 CDT 2009


Author: seanbright
Date: Fri May 22 15:01:11 2009
New Revision: 196381

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196381
Log:
Don't crash if an RTP instance can't be created.  This could occur when an
invalid bindaddr was specified in gtalk.conf.

Modified:
    trunk/channels/chan_gtalk.c

Modified: trunk/channels/chan_gtalk.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_gtalk.c?view=diff&rev=196381&r1=196380&r2=196381
==============================================================================
--- trunk/channels/chan_gtalk.c (original)
+++ trunk/channels/chan_gtalk.c Fri May 22 15:01:11 2009
@@ -947,7 +947,11 @@
 		tmp->initiator = 1;
 	}
 	/* clear codecs */
-	tmp->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+	if (!(tmp->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL))) {
+	  ast_log(LOG_ERROR, "Failed to create a new RTP instance (possibly an invalid bindaddr?)\n");
+	  ast_free(tmp);
+	  return NULL;
+	}
 	ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_RTCP, 1);
 	ast_rtp_codecs_payloads_clear(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp);
 




More information about the svn-commits mailing list