]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
stasis_bridge.c: Fix off-nominal stasis control ref leak. 90/4790/1
authorRichard Mudgett <rmudgett@digium.com>
Sat, 14 Jan 2017 01:08:53 +0000 (19:08 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 24 Jan 2017 19:59:20 +0000 (13:59 -0600)
Change-Id: Ib17218343a6596832060180e19386da9df150ac8

res/stasis/stasis_bridge.c

index aa21ec29c3adad49b618d0df14696f349ddaddaf..549c39d94b8cb460bec54c94178235175cafa4eb 100644 (file)
@@ -217,6 +217,7 @@ static int bridge_stasis_push(struct ast_bridge *self, struct ast_bridge_channel
                 */
                return -1;
        }
+       ao2_cleanup(control);
 
        /*
         * If going into a holding bridge, default the role to participant, if
@@ -236,7 +237,6 @@ static int bridge_stasis_push(struct ast_bridge *self, struct ast_bridge_channel
                }
        }
 
-       ao2_cleanup(control);
        if (self->allowed_capabilities & STASIS_BRIDGE_MIXING_CAPABILITIES) {
                ast_bridge_channel_update_linkedids(bridge_channel, swap);
                if (ast_test_flag(&self->feature_flags, AST_BRIDGE_FLAG_SMART)) {