From: Richard Mudgett Date: Wed, 7 May 2014 20:58:03 +0000 (+0000) Subject: app_confbridge: Fixed "CBAnn" channels not going away. X-Git-Tag: 12.3.0-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c43360d93648a15083aad22d948eca57d0bb9e57;p=thirdparty%2Fasterisk.git app_confbridge: Fixed "CBAnn" channels not going away. Fixed a ref leak in conf_handle_talker_cb() everytime the conference bridge was found to report a channel's talker status change. The resulting leak caused the "CBAnn" channels and the conference bridge to never be destroyed. Thanks to Richard Kenner on the asterisk-user's list for locating the problem. Reported by: Richard Kenner git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@413454 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index 5700fa64de..8db65ef6e8 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -433,7 +433,6 @@ static void send_conf_stasis(struct confbridge_conference *conference, struct as json_object = ast_json_pack("{s: s}", "conference", conference->name); - if (!json_object) { return; } @@ -448,7 +447,6 @@ static void send_conf_stasis(struct confbridge_conference *conference, struct as chan, json_object); ast_bridge_unlock(conference->bridge); - if (!msg) { return; } @@ -458,7 +456,6 @@ static void send_conf_stasis(struct confbridge_conference *conference, struct as } else { stasis_publish(ast_bridge_topic(conference->bridge), msg); } - } static void send_conf_start_event(struct confbridge_conference *conference) @@ -1448,9 +1445,10 @@ static void conf_handle_talker_destructor(void *pvt_data) static int conf_handle_talker_cb(struct ast_bridge_channel *bridge_channel, void *hook_pvt, int talking) { const char *conf_name = hook_pvt; - struct confbridge_conference *conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); + RAII_VAR(struct confbridge_conference *, conference, NULL, ao2_cleanup); struct ast_json *talking_extras; + conference = ao2_find(conference_bridges, conf_name, OBJ_KEY); if (!conference) { /* Remove the hook since the conference does not exist. */ return -1; @@ -2139,6 +2137,7 @@ static int kick_conference_participant(struct confbridge_conference *conference, struct confbridge_user *user = NULL; SCOPED_AO2LOCK(bridge_lock, conference); + AST_LIST_TRAVERSE(&conference->active_list, user, list) { if (!strcasecmp(ast_channel_name(user->chan), channel) && !user->kicked) { user->kicked = 1;