[svn-commits] mmichelson: branch group/CCSS r252082 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 12 15:12:16 CST 2010


Author: mmichelson
Date: Fri Mar 12 15:12:12 2010
New Revision: 252082

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=252082
Log:
Remove extraneous calls to call_destructor_with_no_monitor.

ast_handle_cc_control_frame liked to call this function a second
time. This removes the possibility and simplifies things a bit to
prevent crashes.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=252082&r1=252081&r2=252082
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Mar 12 15:12:12 2010
@@ -1880,33 +1880,28 @@
 
 	if (!(cc_interface = ao2_t_alloc(sizeof(*cc_interface) + device_name_len, cc_interface_destroy,
 					"Allocating new ast_cc_interface"))) {
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	if (!(cc_interface->config_params = ast_cc_config_params_init())) {
 		cc_unref(cc_interface, "Failed to allocate config params, unref interface");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	if (!(monitor = ao2_t_alloc(sizeof(*monitor), cc_monitor_destroy, "Allocating new ast_cc_monitor"))) {
 		cc_unref(cc_interface, "Failed to allocate monitor, unref interface");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	if (!(monitor->dialstring = ast_strdup(dialstring))) {
 		cc_unref(monitor, "Failed to copy dialable name. Unref monitor");
 		cc_unref(cc_interface, "Failed to copy dialable name");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	if (!(monitor->callbacks = find_monitor_callbacks(cc_data->monitor_type))) {
 		cc_unref(monitor, "Failed to find monitor callbacks. Unref monitor");
 		cc_unref(cc_interface, "Failed to find monitor callbacks");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
@@ -2527,7 +2522,6 @@
 	if (!cc_params) {
 		ast_log_dynamic_level(cc_logger_level, "Could not get CC parameters for %s\n",
 			caller);
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 	/* First, we need to kill off other pending CC offers from caller. If the caller is going
@@ -2541,27 +2535,23 @@
 	agent_count = count_agents(caller, recall_core_id);
 	if (agent_count >= ast_get_cc_max_agents(cc_params)) {
 		ast_log_dynamic_level(cc_logger_level, "Caller %s already has the maximum number of agents configured\n", caller);
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	/* Generic agents can only have a single outstanding CC request per caller. */
 	if (agent_count > 0 && ast_get_cc_agent_policy(cc_params) == AST_CC_AGENT_GENERIC) {
 		ast_log_dynamic_level(cc_logger_level, "Generic agents can only have a single outstanding request\n");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	/* Next, we need to create the core instance for this call */
 	if (!(core_instance = ao2_t_alloc(sizeof(*core_instance), cc_core_instance_destructor, "Creating core instance for CC"))) {
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 
 	core_instance->core_id = core_id;
 	if (!(core_instance->agent = cc_agent_init(caller_chan, caller, core_instance->core_id, called_tree))) {
 		cc_unref(core_instance, "Couldn't allocate agent, unref core_instance");
-		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
 		return NULL;
 	}
 




More information about the svn-commits mailing list