]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_confbridge: Plug ref leak of bridge channel with send_events
authorGeorge Joseph <gjoseph@digium.com>
Mon, 8 Jun 2020 00:02:00 +0000 (18:02 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 10 Jun 2020 16:01:17 +0000 (11:01 -0500)
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

apps/confbridge/confbridge_manager.c

index 06cb43321aef3614299d3973eaf14083d5b6ae28..45a1beffc244d156316fdaf61f194f7a7b9953b3 100644 (file)
@@ -367,7 +367,7 @@ static void send_message(const char *msg_name, char *conf_name, struct ast_json
        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) {