summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-05-22 20:01:11 +0000
committerSean Bright <sean@malleable.com>2009-05-22 20:01:11 +0000
commitde6498b2d32a94e418af79ec48b6eca4698a0522 (patch)
tree9dc2319663f207fb106ff4269668611b2d33d4d3 /channels
parentd6759e0117729cef6caf40d4d08617c57eaa9c24 (diff)
Don't crash if an RTP instance can't be created. This could occur when an
invalid bindaddr was specified in gtalk.conf. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_gtalk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c
index 7b430fa09..bfa0915f6 100644
--- a/channels/chan_gtalk.c
+++ b/channels/chan_gtalk.c
@@ -947,7 +947,11 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const
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);