summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-02-21 18:19:31 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-02-21 18:19:31 +0000
commit9e6407c07b30fd7e4c9cb4564fc4a8f4e33955e1 (patch)
treefa4ebc27ea0d7c5e09e32e9339ca5975823a78dc /main/manager.c
parentd277f3ec3ee7a7a38971f5da56bd79347ac6bf9a (diff)
manager: Fix AMI Status action of a single channel.
Fixed use of uninitialized ao2 container iterator in an off-nominal condition. Either a memory allocation error or the requested channel is an internal channel not exposed to the outside. ........ Merged revisions 408715 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/main/manager.c b/main/manager.c
index bc9aab09b..095293921 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -3878,7 +3878,7 @@ static int action_status(struct mansession *s, const struct message *m)
}
/* if we look by name, we break after the first iteration */
- for (; msg; ao2_ref(msg, -1), msg = ao2_iterator_next(&it_chans)) {
+ for (; msg; ao2_ref(msg, -1), msg = all ? ao2_iterator_next(&it_chans) : NULL) {
struct ast_channel_snapshot *snapshot = stasis_message_data(msg);
struct ast_channel *c;
struct ast_str *built = ast_manager_build_channel_state_string_prefix(snapshot, "");
@@ -3961,11 +3961,6 @@ static int action_status(struct mansession *s, const struct message *m)
idText);
ast_free(built);
-
- if (!all) {
- ao2_ref(msg, -1);
- break;
- }
}
if (all) {