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
}
/* 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, "");
idText);
ast_free(built);
-
- if (!all) {
- ao2_ref(msg, -1);
- break;
- }
}
if (all) {