mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer
Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3
This commit is contained in:
@@ -1235,8 +1235,8 @@ static void mwi_contact_deleted(const void *object)
|
|||||||
const struct ast_sip_contact *contact = object;
|
const struct ast_sip_contact *contact = object;
|
||||||
struct ao2_iterator *mwi_subs;
|
struct ao2_iterator *mwi_subs;
|
||||||
struct mwi_subscription *mwi_sub;
|
struct mwi_subscription *mwi_sub;
|
||||||
RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
|
struct ast_sip_endpoint *endpoint = NULL;
|
||||||
RAII_VAR(struct ast_sip_contact *, found_contact, NULL, ao2_cleanup);
|
struct ast_sip_contact *found_contact;
|
||||||
|
|
||||||
if (contact->endpoint) {
|
if (contact->endpoint) {
|
||||||
endpoint = ao2_bump(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)) {
|
if (!endpoint || ast_strlen_zero(endpoint->subscription.mwi.mailboxes)) {
|
||||||
|
ao2_cleanup(endpoint);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if there is another contact */
|
/* Check if there is another contact */
|
||||||
found_contact = ast_sip_location_retrieve_contact_from_aor_list(endpoint->aors);
|
found_contact = ast_sip_location_retrieve_contact_from_aor_list(endpoint->aors);
|
||||||
|
ao2_cleanup(endpoint);
|
||||||
if (found_contact) {
|
if (found_contact) {
|
||||||
|
ao2_cleanup(found_contact);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user