[asterisk-commits] mmichelson: branch mmichelson/atxfer_features r393439 - /team/mmichelson/atxf...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 2 11:21:25 CDT 2013


Author: mmichelson
Date: Tue Jul  2 11:21:23 2013
New Revision: 393439

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393439
Log:
Switch where the transfer target channel refcount is increased.

It turns out I had a refleak if there was a failure that occurred
between the ref bump and imparting the channel to the bridge.


Modified:
    team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diff&rev=393439&r1=393438&r2=393439
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Tue Jul  2 11:21:23 2013
@@ -2246,11 +2246,6 @@
 		return 0;
 	}
 
-	/* We increase the refcount of the transfer target because ast_bridge_impart() will
-	 * steal the reference we already have. We need to keep a reference, so the only
-	 * choice is to give it a bump
-	 */
-	ast_channel_ref(props->transfer_target);
 
 	/* Create a bridge to use to talk to the person we are calling */
 	props->target_bridge = ast_bridge_basic_new();
@@ -2288,6 +2283,11 @@
 		return 0;
 	}
 
+	/* We increase the refcount of the transfer target because ast_bridge_impart() will
+	 * steal the reference we already have. We need to keep a reference, so the only
+	 * choice is to give it a bump
+	 */
+	ast_channel_ref(props->transfer_target);
 	if (ast_bridge_impart(props->target_bridge, props->transfer_target, NULL, NULL, 1)) {
 		ast_log(LOG_ERROR, "Unable to place transfer target into bridge\n");
 		ast_stream_and_wait(bridge_channel->chan, props->failsound, AST_DIGIT_NONE);




More information about the asterisk-commits mailing list