summaryrefslogtreecommitdiff
path: root/apps/app_confbridge.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-05-07 20:39:29 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-05-07 20:39:29 +0000
commit90b9413a0d0381b9227116939d4c38450222b501 (patch)
tree75c3b8745e91a2a534a530fa12fae2c4581b1a1d /apps/app_confbridge.c
parent2d572eafb97823db23137406897d0f55c3b2ee6b (diff)
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 ........ Merged revisions 413452 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_confbridge.c')
-rw-r--r--apps/app_confbridge.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index ed6a8a973..07069edf0 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -2283,6 +2283,7 @@ static char *complete_confbridge_participant(const char *conference_name, const
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:
@@ -2310,11 +2311,12 @@ static char *handle_cli_confbridge_kick(struct ast_cli_entry *e, int cmd, struct
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;
}
@@ -2948,7 +2950,7 @@ static int action_confbridgekick(struct mansession *s, const struct message *m)
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.");