]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_pubsub: On recreated notify fail deleted sub_tree is referenced 30/1130/1
authorJoshua Colp <jcolp@digium.com>
Mon, 24 Aug 2015 16:04:57 +0000 (13:04 -0300)
committerJoshua Colp <jcolp@digium.com>
Mon, 24 Aug 2015 16:06:09 +0000 (13:06 -0300)
When recreating a subscription it is possible for a freed sub_tree
to be referenced when the initial NOTIFY fails to be created.

Change-Id: I681c215309aad01b21d611c2de47b3b0a6022788

res/res_pjsip_pubsub.c

index 3e3ced71f94132cc6f57e3792f26bffcef147929..8cd5b7bf18388e9a9bc49ba2b372f1f755cc8938 100644 (file)
@@ -1393,8 +1393,9 @@ static int subscription_persistence_recreate(void *obj, void *arg, int flags)
                subscription_persistence_update(sub_tree, &rdata);
                if (generate_initial_notify(sub_tree->root)) {
                        pjsip_evsub_terminate(sub_tree->evsub, PJ_TRUE);
+               } else {
+                       send_notify(sub_tree, 1);
                }
-               send_notify(sub_tree, 1);
        } else {
                ast_sorcery_delete(ast_sip_get_sorcery(), persistence);
        }