[asterisk-commits] rmudgett: trunk r408723 - in /trunk: ./ main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 21 12:19:34 CST 2014


Author: rmudgett
Date: Fri Feb 21 12:19:31 2014
New Revision: 408723

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408723
Log:
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

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=408723&r1=408722&r2=408723
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Feb 21 12:19:31 2014
@@ -3878,7 +3878,7 @@
 	}
 
 	/* 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 @@
 			idText);
 
 		ast_free(built);
-
-		if (!all) {
-			ao2_ref(msg, -1);
-			break;
-		}
 	}
 
 	if (all) {




More information about the asterisk-commits mailing list