diff options
author | Joshua Colp <jcolp@digium.com> | 2017-12-20 08:34:37 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-20 08:34:37 -0600 |
commit | 616659d62012a1dc5eb69376f35d2c89fceaf6ea (patch) | |
tree | 891fd4e1f991c01079b5baa05eba39018d919dc6 /main/cli.c | |
parent | b1002338018a37043096d0b6bbe2854bc36d68cc (diff) | |
parent | 9adffca9c786c3b62eefd9de519287b9801f9fec (diff) |
Merge "CLI: Address multiple issues." into 13
Diffstat (limited to 'main/cli.c')
-rw-r--r-- | main/cli.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c index 7039b72fc..fe20c3401 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1522,17 +1522,20 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar return CLI_FAILURE; } - output = ast_str_create(8192); - if (!output) { - return CLI_FAILURE; - } - chan = ast_channel_get_by_name(a->argv[3]); if (!chan) { ast_cli(a->fd, "%s is not a known channel\n", a->argv[3]); + return CLI_SUCCESS; } + output = ast_str_create(8192); + if (!output) { + ast_channel_unref(chan); + + return CLI_FAILURE; + } + now = ast_tvnow(); ast_channel_lock(chan); |