Only write a frame out to the channel if one exists. There are cases where one may not and would therefore cause the channel driver to segfault. (issue #8434 reported by slimey)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-01-13 06:00:24 +00:00
parent cc242206c6
commit e4de85c4f5

View File

@@ -2650,8 +2650,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
/* and now put it through the regular translator */ /* and now put it through the regular translator */
f = (chan->writetrans) ? ast_translate(chan->writetrans, f, 0) : f; f = (chan->writetrans) ? ast_translate(chan->writetrans, f, 0) : f;
} }
if (f)
res = chan->tech->write(chan, f); res = chan->tech->write(chan, f);
else
res = 0;
break; break;
case AST_FRAME_NULL: case AST_FRAME_NULL:
case AST_FRAME_IAX: case AST_FRAME_IAX: