[asterisk-commits] mmichelson: branch mmichelson/more_transfer r387868 - /team/mmichelson/more_t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 7 17:08:10 CDT 2013


Author: mmichelson
Date: Tue May  7 17:08:08 2013
New Revision: 387868

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387868
Log:
Handle potential failures in Bridge application.


Modified:
    team/mmichelson/more_transfer/main/features.c

Modified: team/mmichelson/more_transfer/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/main/features.c?view=diff&rev=387868&r1=387867&r2=387868
==============================================================================
--- team/mmichelson/more_transfer/main/features.c (original)
+++ team/mmichelson/more_transfer/main/features.c Tue May  7 17:08:08 2013
@@ -8122,8 +8122,19 @@
 	}
 
 	bridge = ast_bridge_basic_new();
-
-	add_to_bridge(bridge, current_dest_chan, peer_features, ast_test_flag(&opts, BRIDGE_OPT_PLAYTONE));
+	if (!bridge) {
+		ast_bridge_features_destroy(peer_features);
+		ast_bridge_features_cleanup(&chan_features);
+		goto done;
+	}
+
+	if (add_to_bridge(bridge, current_dest_chan, peer_features, ast_test_flag(&opts, BRIDGE_OPT_PLAYTONE)))
+	{
+		ast_bridge_features_destroy(peer_features);
+		ast_bridge_features_cleanup(&chan_features);
+		ast_bridge_destroy(bridge);
+		goto done;
+	}
 
 	ast_bridge_join(bridge, chan, NULL, &chan_features, NULL, 1);
 




More information about the asterisk-commits mailing list