add a check to prevent a seg fault from an unknown cause ... (bug #3496)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Russell Bryant 21 years ago
parent ee53dc7286
commit fd7f18421d

@ -1576,7 +1576,8 @@ static int skinny_answer(struct ast_channel *ast)
static struct ast_frame *skinny_rtp_read(struct skinny_subchannel *sub) static struct ast_frame *skinny_rtp_read(struct skinny_subchannel *sub)
{ {
/* Retrieve audio/etc from channel. Assumes sub->lock is already held. */ /* Retrieve audio/etc from channel. Assumes sub->lock is already held. */
struct ast_frame *f; struct ast_frame *f = NULL;
if (sub->rtp) {
f = ast_rtp_read(sub->rtp); f = ast_rtp_read(sub->rtp);
if (sub->owner) { if (sub->owner) {
/* We already hold the channel lock */ /* We already hold the channel lock */
@ -1589,6 +1590,8 @@ static struct ast_frame *skinny_rtp_read(struct skinny_subchannel *sub)
} }
} }
} }
} else
ast_log(LOG_WARNING, "sub->rtp is NULL - calling read on a channel that has been hungup?\n");
return f; return f;
} }

Loading…
Cancel
Save