[asterisk-commits] rmudgett: branch 11 r413451 - /branches/11/apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 7 15:29:15 CDT 2014


Author: rmudgett
Date: Wed May  7 15:29:09 2014
New Revision: 413451

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413451
Log:
app_confbridge: Fix ref leak in CLI "confbridge kick" command.

Fixed ref leak in the CLI "confbridge kick" command when the channel to be
kicked was not in the conference.

Modified:
    branches/11/apps/app_confbridge.c

Modified: branches/11/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/apps/app_confbridge.c?view=diff&rev=413451&r1=413450&r2=413451
==============================================================================
--- branches/11/apps/app_confbridge.c (original)
+++ branches/11/apps/app_confbridge.c Wed May  7 15:29:09 2014
@@ -2228,6 +2228,7 @@
 {
 	struct conference_bridge *bridge = NULL;
 	struct conference_bridge tmp;
+	int not_found;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -2256,11 +2257,12 @@
 		ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
 		return CLI_SUCCESS;
 	}
-	if (kick_conference_participant(bridge, a->argv[3])) {
+	not_found = kick_conference_participant(bridge, a->argv[3]);
+	ao2_ref(bridge, -1);
+	if (not_found) {
 		ast_cli(a->fd, "No participant named '%s' found!\n", a->argv[3]);
 		return CLI_SUCCESS;
 	}
-	ao2_ref(bridge, -1);
 	ast_cli(a->fd, "Participant '%s' kicked out of conference '%s'\n", a->argv[3], a->argv[2]);
 	return CLI_SUCCESS;
 }
@@ -2857,7 +2859,7 @@
 	const char *channel = astman_get_header(m, "Channel");
 	struct conference_bridge *bridge = NULL;
 	struct conference_bridge tmp;
-	int found = 0;
+	int found;
 
 	if (ast_strlen_zero(conference)) {
 		astman_send_error(s, m, "No Conference name provided.");




More information about the asterisk-commits mailing list