[asterisk-commits] kmoore: branch group/media_formats-reviewed-trunk r418712 - /team/group/media...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 16:58:41 CDT 2014


Author: kmoore
Date: Tue Jul 15 16:58:34 2014
New Revision: 418712

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418712
Log:
media formats: Fix format leak in bridging

Fix a format reference leak in bridge_make_compatible when calling into
confbridge with pjsip channels.

Review: https://reviewboard.asterisk.org/r/3801/

Modified:
    team/group/media_formats-reviewed-trunk/main/bridge.c

Modified: team/group/media_formats-reviewed-trunk/main/bridge.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/bridge.c?view=diff&rev=418712&r1=418711&r2=418712
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/bridge.c (original)
+++ team/group/media_formats-reviewed-trunk/main/bridge.c Tue Jul 15 16:58:34 2014
@@ -956,11 +956,13 @@
 		if (ast_set_read_format(bridge_channel->chan, best_format)) {
 			ast_log(LOG_WARNING, "Failed to set channel %s to read format %s\n",
 				ast_channel_name(bridge_channel->chan), ast_format_get_name(best_format));
+			ao2_cleanup(best_format);
 			return -1;
 		}
 		ast_debug(1, "Bridge %s put channel %s into read format %s\n",
 			bridge->uniqueid, ast_channel_name(bridge_channel->chan),
 			ast_format_get_name(best_format));
+		ao2_cleanup(best_format);
 	} else {
 		ast_debug(1, "Bridge %s is happy that channel %s already has read format %s\n",
 			bridge->uniqueid, ast_channel_name(bridge_channel->chan),
@@ -980,11 +982,13 @@
 		if (ast_set_write_format(bridge_channel->chan, best_format)) {
 			ast_log(LOG_WARNING, "Failed to set channel %s to write format %s\n",
 				ast_channel_name(bridge_channel->chan), ast_format_get_name(best_format));
+			ao2_cleanup(best_format);
 			return -1;
 		}
 		ast_debug(1, "Bridge %s put channel %s into write format %s\n",
 			bridge->uniqueid, ast_channel_name(bridge_channel->chan),
 			ast_format_get_name(best_format));
+		ao2_cleanup(best_format);
 	} else {
 		ast_debug(1, "Bridge %s is happy that channel %s already has write format %s\n",
 			bridge->uniqueid, ast_channel_name(bridge_channel->chan),




More information about the asterisk-commits mailing list