summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2018-01-10 08:11:53 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2018-01-10 08:11:53 -0600
commitcdefdea1cc7ac2f918c6cddb41b1eaa0bfec26a4 (patch)
tree80e1e462965140bca2b94b5ad1bc4eed5e9dd531
parent7f2d6f51ed2b73c05fc5d0b5ff06120af3e2f430 (diff)
parentc67eb7031b3a58ff5ce472eee9519b566a222e41 (diff)
Merge "app_confbridge: Fix NULL check in action_kick_last." into 13
-rw-r--r--apps/app_confbridge.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index ae3df7208..e99311d54 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -2666,17 +2666,23 @@ static int action_kick_last(struct confbridge_conference *conference,
}
ao2_lock(conference);
- if (((last_user = AST_LIST_LAST(&conference->active_list)) == user)
- || (ast_test_flag(&last_user->u_profile, USER_OPT_ADMIN))) {
+ last_user = AST_LIST_LAST(&conference->active_list);
+ if (!last_user) {
+ ao2_unlock(conference);
+ return 0;
+ }
+
+ if (last_user == user || ast_test_flag(&last_user->u_profile, USER_OPT_ADMIN)) {
ao2_unlock(conference);
play_file(bridge_channel, NULL,
conf_get_sound(CONF_SOUND_ERROR_MENU, conference->b_profile.sounds));
- } else if (last_user && !last_user->kicked) {
+ } else if (!last_user->kicked) {
last_user->kicked = 1;
pbx_builtin_setvar_helper(last_user->chan, "CONFBRIDGE_RESULT", "KICKED");
ast_bridge_remove(conference->bridge, last_user->chan);
ao2_unlock(conference);
}
+
return 0;
}