diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-12-20 20:00:50 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-12-20 20:00:50 +0000 |
commit | 72c282cc66d7e12cd17d0eee90e066d9ebfb1243 (patch) | |
tree | 58107b777c3f75160878837662fbaf825163556b /res/ari/resource_channels.c | |
parent | c2fd2ac823d89283a0e9a0a9e8d36c92fba25c27 (diff) |
ao2_iterator: Mini-audit of the ao2_iterator loops in the new code files.
* Fixed several places where ao2_iterator_destroy() was not called.
* Fixed several iterator loop object variable reference problems.
* Fixed res_parking AMI actions returning non-zero. Only the AMI logoff
action can return non-zero.
Review: https://reviewboard.asterisk.org/r/3087/
........
Merged revisions 404434 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari/resource_channels.c')
-rw-r--r-- | res/ari/resource_channels.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 08ef15408..667ea73f0 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -663,8 +663,8 @@ void ast_ari_channels_list(struct ast_variable *headers, return; } - for (i = ao2_iterator_init(snapshots, 0); - (obj = ao2_iterator_next(&i)); ao2_cleanup(obj)) { + i = ao2_iterator_init(snapshots, 0); + while ((obj = ao2_iterator_next(&i))) { RAII_VAR(struct stasis_message *, msg, obj, ao2_cleanup); struct ast_channel_snapshot *snapshot = stasis_message_data(msg); int r; @@ -678,7 +678,6 @@ void ast_ari_channels_list(struct ast_variable *headers, json, ast_channel_snapshot_to_json(snapshot, NULL)); if (r != 0) { ast_ari_response_alloc_failed(response); - ao2_cleanup(obj); ao2_iterator_destroy(&i); return; } |