summaryrefslogtreecommitdiff
path: root/res/res_pjsip_pubsub.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-10-29 10:28:33 -0300
committerJoshua Colp <jcolp@digium.com>2015-10-29 10:28:33 -0300
commit9a021a42adaee95d115aa3200467943fecd1f13a (patch)
tree2da39ffbde975d72bb43b02b6270852eb31ae084 /res/res_pjsip_pubsub.c
parentb640858e9bbc0f31dbcda80553b8413c32ff1a82 (diff)
res_pjsip_pubsub: Fix assertion when UAS dialog creation fails.
When compiled with assertions enabled one will occur when destroying the subscription tree when UAS dialog creation fails. This is because the code assumes that a dialog will always exist on a subscription tree when in reality during this specific scenario it won't. This change makes it so a dialog is not removed from the subscription tree if it is not present. ASTERISK-25505 #close Change-Id: Id5c182b055aacc5e66c80546c64804ce19218dee
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r--res/res_pjsip_pubsub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index cbedaf28c..99376b142 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1208,7 +1208,10 @@ static void subscription_tree_destructor(void *obj)
destroy_subscriptions(sub_tree->root);
- ast_sip_push_task_synchronous(sub_tree->serializer, subscription_unreference_dialog, sub_tree);
+ if (sub_tree->dlg) {
+ ast_sip_push_task_synchronous(sub_tree->serializer, subscription_unreference_dialog, sub_tree);
+ }
+
ast_taskprocessor_unreference(sub_tree->serializer);
ast_module_unref(ast_module_info->self);
}