]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_pubsub: Fix assertion when UAS dialog creation fails. 40/1540/1
authorJoshua Colp <jcolp@digium.com>
Thu, 29 Oct 2015 13:28:33 +0000 (10:28 -0300)
committerJoshua Colp <jcolp@digium.com>
Thu, 29 Oct 2015 13:28:33 +0000 (10:28 -0300)
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

res/res_pjsip_pubsub.c

index cbedaf28c4c478d4e6d94f31d3002fdbb4137cd9..99376b142c0d93c2e2f074b18b0468ba6a89b46a 100644 (file)
@@ -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);
 }