diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-10-27 01:15:02 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-10-27 01:15:02 +0000 |
commit | 024bd67277cfb7d8b95af9743d7c3c7bafa7dd0e (patch) | |
tree | 33c24cab681846805633977e374f1eb6823748d0 /funcs/func_shell.c | |
parent | db88298c18adac7bd279052f253bfd271283f8cf (diff) |
Make sure a channel exists before attempting to start or stop channel
autoservice in func_lock and func_shell.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_shell.c')
-rw-r--r-- | funcs/func_shell.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/funcs/func_shell.c b/funcs/func_shell.c index 9653fcab0..3acafe25a 100644 --- a/funcs/func_shell.c +++ b/funcs/func_shell.c @@ -49,7 +49,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data, return -1; } - ast_autoservice_start(chan); + if (chan) + ast_autoservice_start(chan); if (len >= 1) { FILE *ptr; @@ -62,7 +63,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data, pclose(ptr); } - ast_autoservice_stop(chan); + if (chan) + ast_autoservice_stop(chan); return 0; } |