[asterisk-commits] res pjsip pubsub: Fix reference to released endpoint (asterisk[14])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 15 15:25:16 CDT 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5834 )
Change subject: res_pjsip_pubsub: Fix reference to released endpoint
......................................................................
res_pjsip_pubsub: Fix reference to released endpoint
destroy_subscription was attempting to get the id of the
subscription tree's endpoint after we'd already called ao2_cleanup
on it causing a segfault.
Moved the cleanup until after the debug statement and since
endpoint could also be NULL at this point, check for that as well.
ASTERISK-27057 #close
Reported-by: Ryan Smith
Change-Id: Ice0a7727f560cf204d870a774c6df71e159b1678
---
M res/res_pjsip_pubsub.c
1 file changed, 5 insertions(+), 3 deletions(-)
Approvals:
Mark Michelson: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
Kevin Harwell: Looks good to me, approved
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index a1f3f24..9f0eae2 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1086,7 +1086,9 @@
static void destroy_subscription(struct ast_sip_subscription *sub)
{
ast_debug(3, "Destroying SIP subscription from '%s->%s'\n",
- ast_sorcery_object_get_id(sub->tree->endpoint), sub->resource);
+ sub->tree->endpoint ? ast_sorcery_object_get_id(sub->tree->endpoint) : "Unknown",
+ sub->resource);
+
ast_free(sub->body_text);
AST_VECTOR_FREE(&sub->children);
@@ -1243,14 +1245,14 @@
sub_tree->endpoint ? ast_sorcery_object_get_id(sub_tree->endpoint) : "Unknown",
sub_tree->root ? sub_tree->root->resource : "Unknown");
- ao2_cleanup(sub_tree->endpoint);
-
destroy_subscriptions(sub_tree->root);
if (sub_tree->dlg) {
ast_sip_push_task_synchronous(sub_tree->serializer, subscription_unreference_dialog, sub_tree);
}
+ ao2_cleanup(sub_tree->endpoint);
+
ast_taskprocessor_unreference(sub_tree->serializer);
ast_module_unref(ast_module_info->self);
}
--
To view, visit https://gerrit.asterisk.org/5834
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice0a7727f560cf204d870a774c6df71e159b1678
Gerrit-Change-Number: 5834
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170615/d44c0f13/attachment-0001.html>
More information about the asterisk-commits
mailing list