summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/main/cli.c b/main/cli.c
index 8e0cc3bd3..fe20c3401 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1418,6 +1418,8 @@ static char *handle_core_set_debug_channel(struct ast_cli_entry *e, int cmd, str
} else if (a->pos == 5) {
return ast_cli_complete(a->word, completions_off, a->n);
}
+
+ return NULL;
}
if (cmd == (CLI_HANDLER + 1000)) {
@@ -1520,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);