diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index f3504ae44b..c9e8834c62 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -2032,7 +2032,10 @@ int ast_sip_subscription_notify(struct ast_sip_subscription *sub, void *notify_d if (sub->tree->notification_batch_interval) { return schedule_notification(sub->tree); } else { + /* See the note in pubsub_on_rx_refresh() for why sub->tree is refbumped here */ + ao2_ref(sub->tree, +1); return send_notify(sub->tree, 0); + ao2_ref(sub->tree, -1); } }