Add missing NULL check to acquire_bridge() function.
authorMark Michelson <mmichelson@digium.com>
Tue, 28 May 2013 15:54:53 +0000 (15:54 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 28 May 2013 15:54:53 +0000 (15:54 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/bridging.c

index 35cb859..2c32577 100644 (file)
@@ -5509,6 +5509,10 @@ static struct ast_bridge *acquire_bridge(struct ast_channel *chan)
        bridge = ast_channel_get_bridge(chan);
        ast_channel_unlock(chan);
 
+       if (!bridge) {
+               return NULL;
+       }
+
        if (ast_test_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_MASQUERADE_ONLY)) {
                ao2_ref(bridge, -1);
                bridge = NULL;