]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main/bridge: Destroy features struct on off nominal path during bridge impart
authorMatthew Jordan <mjordan@digium.com>
Tue, 28 Oct 2014 16:40:33 +0000 (16:40 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 28 Oct 2014 16:40:33 +0000 (16:40 +0000)
When a channel is imparted to a bridge, the invocation of the function may
provide an ast_bridge_features struct. Upon passing this to ast_bridge_impart,
the caller must assume that ownership has passed to the function, as in all
paths the function destroys the struct prior to returning (as its purpose is
to configure the behavior of the channel while in the bridge). On one off
nominal path - where the channel already has a PBX thread - the struct was not
being destroyed.

This patch fixes that glitch.

ASTERISK-24437 #close
Reported by: Scott Griepentrog

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@426431 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/bridge.c

index 2383c7a9300dff0e257bb9953cdb406b58a7d921..af1406d83961a0be169acac16e6650992a6abf3b 100644 (file)
@@ -1667,6 +1667,7 @@ int ast_bridge_impart(struct ast_bridge *bridge,
        if (ast_channel_pbx(chan)) {
                ast_log(AST_LOG_WARNING, "Channel %s has a PBX thread and cannot be imparted into bridge %s\n",
                        ast_channel_name(chan), bridge->uniqueid);
+               ast_bridge_features_destroy(features);
                return -1;
        }