[asterisk-commits] res pjsip mwi.c: Eliminate RAII VAR in contact delete observer (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 22 10:15:59 CDT 2017


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

Change subject: res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer
......................................................................

res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer

Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3
---
M res/res_pjsip_mwi.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index f73f10c..cc4b40a 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -1235,8 +1235,8 @@
 	const struct ast_sip_contact *contact = object;
 	struct ao2_iterator *mwi_subs;
 	struct mwi_subscription *mwi_sub;
-	RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_sip_contact *, found_contact, NULL, ao2_cleanup);
+	struct ast_sip_endpoint *endpoint = NULL;
+	struct ast_sip_contact *found_contact;
 
 	if (contact->endpoint) {
 		endpoint = ao2_bump(contact->endpoint);
@@ -1247,12 +1247,15 @@
 	}
 
 	if (!endpoint || ast_strlen_zero(endpoint->subscription.mwi.mailboxes)) {
+		ao2_cleanup(endpoint);
 		return;
 	}
 
 	/* Check if there is another contact */
 	found_contact = ast_sip_location_retrieve_contact_from_aor_list(endpoint->aors);
+	ao2_cleanup(endpoint);
 	if (found_contact) {
+		ao2_cleanup(found_contact);
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/5899
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3
Gerrit-Change-Number: 5899
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170622/e44d4a08/attachment-0001.html>


More information about the asterisk-commits mailing list