diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-30 16:57:50 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-30 16:57:50 +0000 |
commit | cc3947653d564b8cabc8cc6b3bd400421d3ff70e (patch) | |
tree | e1028bcd8c490aadcaf7582181b4dda99a01ed21 /main/channel.c | |
parent | 8eecc0ae04fd4f5ad30355ab6aa7009b9298e357 (diff) |
Merged revisions 221201 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r221201 | tilghman | 2009-09-30 11:56:42 -0500 (Wed, 30 Sep 2009) | 14 lines
Merged revisions 221200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r221200 | tilghman | 2009-09-30 11:55:21 -0500 (Wed, 30 Sep 2009) | 7 lines
Avoid a potential NULL dereference.
(closes issue #15865)
Reported by: kobaz
Patches:
20090915__issue15865.diff.txt uploaded by tilghman (license 14)
Tested by: kobaz
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@221203 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/main/channel.c b/main/channel.c index 6c1e880a8..483377fb1 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2480,9 +2480,9 @@ static void send_dtmf_event(const struct ast_channel *chan, const char *directio static void ast_read_generator_actions(struct ast_channel *chan, struct ast_frame *f) { - if (chan->generatordata && !ast_internal_timing_enabled(chan)) { + if (chan->generator && chan->generator->generate && chan->generatordata && !ast_internal_timing_enabled(chan)) { void *tmp = chan->generatordata; - int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples) = NULL; + int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples) = chan->generator->generate; int res; int samples; @@ -2501,9 +2501,6 @@ static void ast_read_generator_actions(struct ast_channel *chan, struct ast_fram samples = f->samples; } - if (chan->generator->generate) { - generate = chan->generator->generate; - } /* This unlock is here based on two assumptions that hold true at this point in the * code. 1) this function is only called from within __ast_read() and 2) all generators * call ast_write() in their generate callback. |