[Asterisk-code-review] res pjsip pubsub: Hold module reference for publications. (asterisk[master])

Jenkins2 asteriskteam at digium.com
Tue Jul 3 08:40:40 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/9320 )

Change subject: res_pjsip_pubsub: Hold module reference for publications.
......................................................................

res_pjsip_pubsub: Hold module reference for publications.

Incoming publications need to ensure that the module remains
loaded for the lifetime of them. This is now done by holding
a reference to the module while the publication exists. This
mirrors that of inbound subscriptions.

ASTERISK-27783

Change-Id: Ia98c95a15e11af25728d5fb3e56e12cda0cfc7c0
---
M res/res_pjsip_pubsub.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index d984914..587c533 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -3091,6 +3091,8 @@
 
 	ao2_cleanup(publication->datastores);
 	ao2_cleanup(publication->endpoint);
+
+	ast_module_unref(ast_module_info->self);
 }
 
 static struct ast_sip_publication *sip_create_publication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata,
@@ -3107,6 +3109,8 @@
 		return NULL;
 	}
 
+	ast_module_ref(ast_module_info->self);
+
 	if (!(publication->datastores = ast_datastores_alloc())) {
 		ao2_ref(publication, -1);
 		return NULL;

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia98c95a15e11af25728d5fb3e56e12cda0cfc7c0
Gerrit-Change-Number: 9320
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180703/3ff19881/attachment.html>


More information about the asterisk-code-review mailing list