[svn-commits] rmudgett: branch 12 r413452 - in /branches/12: ./ apps/app_confbridge.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 7 15:35:02 CDT 2014


Author: rmudgett
Date: Wed May  7 15:34:58 2014
New Revision: 413452

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

Merged revisions 413451 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/apps/app_confbridge.c

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

Modified: branches/12/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_confbridge.c?view=diff&rev=413452&r1=413451&r2=413452
==============================================================================
--- branches/12/apps/app_confbridge.c (original)
+++ branches/12/apps/app_confbridge.c Wed May  7 15:34:58 2014
@@ -2227,6 +2227,7 @@
 static char *handle_cli_confbridge_kick(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct confbridge_conference *conference;
+	int not_found;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -2254,11 +2255,12 @@
 		ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
 		return CLI_SUCCESS;
 	}
-	if (kick_conference_participant(conference, a->argv[3])) {
+	not_found = kick_conference_participant(conference, a->argv[3]);
+	ao2_ref(conference, -1);
+	if (not_found) {
 		ast_cli(a->fd, "No participant named '%s' found!\n", a->argv[3]);
 		return CLI_SUCCESS;
 	}
-	ao2_ref(conference, -1);
 	ast_cli(a->fd, "Participant '%s' kicked out of conference '%s'\n", a->argv[3], a->argv[2]);
 	return CLI_SUCCESS;
 }
@@ -2892,7 +2894,7 @@
 	const char *conference_name = astman_get_header(m, "Conference");
 	const char *channel = astman_get_header(m, "Channel");
 	struct confbridge_conference *conference;
-	int found = 0;
+	int found;
 
 	if (ast_strlen_zero(conference_name)) {
 		astman_send_error(s, m, "No Conference name provided.");




More information about the svn-commits mailing list