From e4de85c4f5dc83b9448cb8fcf399301f87a216f9 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Sat, 13 Jan 2007 06:00:24 +0000 Subject: [PATCH] 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 --- main/channel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/channel.c b/main/channel.c index e895d27831..1dd1e0c74e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2650,8 +2650,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr) /* and now put it through the regular translator */ f = (chan->writetrans) ? ast_translate(chan->writetrans, f, 0) : f; } - - res = chan->tech->write(chan, f); + if (f) + res = chan->tech->write(chan, f); + else + res = 0; break; case AST_FRAME_NULL: case AST_FRAME_IAX: