aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-13 06:00:24 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-13 06:00:24 +0000
commit83cb29b27e47a3268364518338856d8efeebc2d0 (patch)
tree80288822e5c1b3bf8ca1ccbc6aa2d249ae734ab4 /main/channel.c
parent896b80ee76e6b42915f6d7d099c46b3f741f67ad (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@50727 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index e895d2783..1dd1e0c74 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: