[Asterisk-code-review] res_pjsip_pubsub: Increment persistence data ref when recreating. (asterisk[16])

Joshua Colp asteriskteam at digium.com
Tue Jan 28 09:23:07 CST 2020


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13680 )


Change subject: res_pjsip_pubsub: Increment persistence data ref when recreating.
......................................................................

res_pjsip_pubsub: Increment persistence data ref when recreating.

Each subscription needs to have a reference to the persisted data
for it, as well as the main JSON contained within the tree. When
recreating a subscription this did not occur and they both shared
the same reference.

ASTERISK-28714

Change-Id: I706abd49ea182ea367a4ac3feca2706460ae9f4a
---
M res/res_pjsip_pubsub.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/80/13680/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 32e0adf..bfa3dc9 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1264,7 +1264,7 @@
 	 */
 
 	if (tree->persistence && tree->persistence->generator_data) {
-		sub->persistence_data = ast_json_object_get(tree->persistence->generator_data, resource);
+		sub->persistence_data = ast_json_ref(ast_json_object_get(tree->persistence->generator_data, resource));
 	}
 
 	sub->handler = handler;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13680
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I706abd49ea182ea367a4ac3feca2706460ae9f4a
Gerrit-Change-Number: 13680
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200128/706291ae/attachment.html>


More information about the asterisk-code-review mailing list