summaryrefslogtreecommitdiff
path: root/res/res_pjsip_mwi.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-06-21 17:57:11 -0500
committerRichard Mudgett <rmudgett@digium.com>2017-06-21 18:25:17 -0500
commit975e271b0189844c37f922b5807c61b1c7537634 (patch)
tree779786106eade7e1522300ecb0db47048604df9f /res/res_pjsip_mwi.c
parent01536546e226efb87bdc64a4a5908e33d7ec98a4 (diff)
res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer
Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3
Diffstat (limited to 'res/res_pjsip_mwi.c')
-rw-r--r--res/res_pjsip_mwi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index f73f10cd6..cc4b40a04 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -1235,8 +1235,8 @@ static void mwi_contact_deleted(const void *object)
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 @@ static void mwi_contact_deleted(const void *object)
}
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;
}