[svn-commits] kmoore: branch 12 r411790 - /branches/12/res/res_pjsip_pubsub.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 7 08:24:17 CDT 2014


Author: kmoore
Date: Mon Apr  7 08:24:09 2014
New Revision: 411790

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411790
Log:
PJSIP: Fix crash introduced in r411671

The test event introduced in revision 411671 uses a dangling pointer to
access information about pubsub state changes. This moves the event to
within the lifetime of the pointer.

Modified:
    branches/12/res/res_pjsip_pubsub.c

Modified: branches/12/res/res_pjsip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_pubsub.c?view=diff&rev=411790&r1=411789&r2=411790
==============================================================================
--- branches/12/res/res_pjsip_pubsub.c (original)
+++ branches/12/res/res_pjsip_pubsub.c Mon Apr  7 08:24:09 2014
@@ -466,17 +466,16 @@
 int ast_sip_subscription_send_request(struct ast_sip_subscription *sub, pjsip_tx_data *tdata)
 {
 	struct ast_sip_endpoint *endpoint = ast_sip_subscription_get_endpoint(sub);
-	int res = pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
-			tdata) == PJ_SUCCESS ? 0 : -1;
-	
+
 	ast_test_suite_event_notify("SUBSCRIPTION_STATE_SET",
 		"StateText: %s\r\n"
 		"Endpoint: %s\r\n",
 		pjsip_evsub_get_state_name(ast_sip_subscription_get_evsub(sub)),
 		ast_sorcery_object_get_id(endpoint));
-	
 	ao2_cleanup(endpoint);
-	return res;
+
+	return pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
+			tdata) == PJ_SUCCESS ? 0 : -1;
 }
 
 static void subscription_datastore_destroy(void *obj)




More information about the svn-commits mailing list