[asterisk-commits] res pjsip pubsub: On notify fail deleted sub tree is then re... (asterisk[certified/13.1])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 21 13:21:36 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res_pjsip_pubsub: On notify fail deleted sub_tree is then referenced
......................................................................


res_pjsip_pubsub: On notify fail deleted sub_tree is then referenced

This change makes the send_notify of the sub_tree
not happen when the sub_tree has been deleted due
to the notify call failing, which avoids a crash.

ASTERISK-24970 #close

Change-Id: I1f20ffc08b192f59c457293b218025a693992cbf
(cherry picked from commit 8d4ce7cc2b87317005588e700b278a8cca7005c8)
---
M res/res_pjsip_pubsub.c
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Scott Griepentrog: Looks good to me, but someone else must approve
  Matt Jordan: Looks good to me, approved



diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 3eb0eeb..24c1554 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2607,11 +2607,12 @@
 		sip_subscription_accept(sub_tree, rdata, resp);
 		if (generate_initial_notify(sub_tree->root)) {
 			pjsip_evsub_terminate(sub_tree->evsub, PJ_TRUE);
+		} else {
+			send_notify(sub_tree, 1);
+			ast_test_suite_event_notify("SUBSCRIPTION_ESTABLISHED",
+					"Resource: %s",
+					sub_tree->root->resource);
 		}
-		send_notify(sub_tree, 1);
-		ast_test_suite_event_notify("SUBSCRIPTION_ESTABLISHED",
-				"Resource: %s",
-				sub_tree->root->resource);
 	}
 
 	resource_tree_destroy(&tree);

-- 
To view, visit https://gerrit.asterisk.org/1125
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f20ffc08b192f59c457293b218025a693992cbf
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-commits mailing list