]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_pubsub: Fix ao2 reference leak of subscription tree in ast_sip_subscription
authorAlexei Gradinari <alex2grad@gmail.com>
Wed, 7 Jan 2026 20:39:05 +0000 (15:39 -0500)
committerAlexei Gradinari <alex2grad@gmail.com>
Thu, 22 Jan 2026 17:51:17 +0000 (17:51 +0000)
commit6cc8b96452d034bf8be14495c7491102574359fd
tree364311d0203685936787ebe95f42914a93ac7d28
parentbb4b3b0fd59b896bcb923f274cea1d8ec7c56713
res_pjsip_pubsub: Fix ao2 reference leak of subscription tree in ast_sip_subscription

allocate_subscription() increments the ao2 reference count of the subscription tree,
but the reference was not consistently released during subscription destruction,
resulting in leaked sip_subscription_tree objects.

This patch makes destroy_subscription() responsible for releasing sub->tree,
removes ad-hoc cleanup in error paths,
and guards tree cleanup to ensure refcount symmetry and correct ownership.

Fixes: #1703
res/res_pjsip_pubsub.c