[asterisk-commits] mmichelson: branch group/CCSS r240473 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 15 15:28:15 CST 2010


Author: mmichelson
Date: Fri Jan 15 15:28:11 2010
New Revision: 240473

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240473
Log:
Fix potential crash if sip_alloc fails in SIP's request_cc callback.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=240473&r1=240472&r2=240473
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Fri Jan 15 15:28:11 2010
@@ -3693,13 +3693,12 @@
 		return -1;
 	}
 
+	if (!(monitor_instance->subscription_pvt = sip_alloc(NULL, NULL, 0, SIP_SUBSCRIBE, NULL))) {
+		return -1;
+	}
+
 	monitor_instance->monitor = monitor;
 	ao2_ref(monitor_instance->monitor, +1);
-
-	if (!(monitor_instance->subscription_pvt = sip_alloc(NULL, NULL, 0, SIP_SUBSCRIBE, NULL))) {
-		ao2_ref(monitor_instance->monitor, -1);
-		return -1;
-	}
 	
 	when = service == AST_CC_CCBS ? ast_get_ccbs_available_timer(monitor->interface->config_params) :
 		ast_get_ccnr_available_timer(monitor->interface->config_params);




More information about the asterisk-commits mailing list