]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
rtp_engine: Clean up after a failed remote bridge
authorKinsey Moore <kmoore@digium.com>
Tue, 4 Mar 2014 15:31:05 +0000 (15:31 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 4 Mar 2014 15:31:05 +0000 (15:31 +0000)
Upon failure of an INVITE transaction meant to initiate a remote native
bridge, rtp_engine.c would not clean up non-reference-counted bridge
instance pointers leaving a dangling pointer which was being used to
perform a local native bridge after the other channel had hung up. This
lead to dereferencing into freed memory and plenty of AO2 errors. This
change allows the remote native bridge loop to clean up properly when
the bridge fails.

(closes issue ASTERISK-23310)
Reported by: Jeremy Laine

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

main/rtp_engine.c

index 8a449e562348584b206566021144be104697696f..646aa2dfda2f29ab9ab73d91b4d24376a9db46b8 100644 (file)
@@ -1211,7 +1211,8 @@ static enum ast_bridge_result remote_bridge_loop(struct ast_channel *c0, struct
                                *fo = fr;
                                *rc = who;
                                ast_debug(1, "Got a FRAME_CONTROL (%d) frame on channel %s\n", fr->subclass.integer, who->name);
-                               return AST_BRIDGE_COMPLETE;
+                               res = AST_BRIDGE_COMPLETE;
+                               break;
                        }
                } else {
                        if ((fr->frametype == AST_FRAME_DTMF_BEGIN) ||