[Asterisk-code-review] app_confbridge: Plug ref leak of bridge channel with send_events (asterisk[certified/16.8])

George Joseph asteriskteam at digium.com
Wed Jun 10 14:00:18 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14521 )

Change subject: app_confbridge: Plug ref leak of bridge channel with send_events
......................................................................

app_confbridge: Plug ref leak of bridge channel with send_events

When send_events is enabled for a user, we were leaking a reference
to the bridge channel in confbridge_manager.c:send_message().  This
also caused the bridge snapshot to not be destroyed.

Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97
---
M apps/confbridge/confbridge_manager.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/apps/confbridge/confbridge_manager.c b/apps/confbridge/confbridge_manager.c
index 35d3f72..8cc7e31 100644
--- a/apps/confbridge/confbridge_manager.c
+++ b/apps/confbridge/confbridge_manager.c
@@ -367,7 +367,7 @@
 	char *json;
 	int rc = 0;
 	struct ast_frame f;
-	struct ast_bridge_channel *bridge_chan;
+	RAII_VAR(struct ast_bridge_channel *, bridge_chan, NULL, ao2_cleanup);
 
 	bridge_chan = ast_channel_get_bridge_channel(chan);
 	if (!bridge_chan) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14521
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: certified/16.8
Gerrit-Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97
Gerrit-Change-Number: 14521
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200610/4cbdb339/attachment.html>


More information about the asterisk-code-review mailing list