stasis/control.c: Fix set_interval_hook() ref leak.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 6 Sep 2017 18:38:17 +0000 (13:38 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 6 Sep 2017 18:40:12 +0000 (13:40 -0500)
Change-Id: Ia0edb7dc0dbbb879c079ff7000f1b722d86ce7dc

res/stasis/control.c

index 503f111..7356fe8 100644 (file)
@@ -1133,10 +1133,12 @@ static void set_interval_hook(struct ast_channel *chan)
 
        if (ast_bridge_interval_hook(bridge_channel->features, 0, ms > 0 ? ms : 1,
                        bridge_timeout, NULL, NULL, 0)) {
+               ao2_ref(bridge_channel, -1);
                return;
        }
 
        ast_queue_frame(bridge_channel->chan, &ast_null_frame);
+       ao2_ref(bridge_channel, -1);
 }
 
 int control_swap_channel_in_bridge(struct stasis_app_control *control, struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap)