summaryrefslogtreecommitdiff
path: root/res/res_pjsip_mwi.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-06-30 11:14:57 -0500
committerRichard Mudgett <rmudgett@digium.com>2015-07-06 16:10:57 -0500
commit453d7b8d699443e494ae1442a9c8810f20435346 (patch)
treebfbba4853f380ba87af67b4e0b047a0a716cfae1 /res/res_pjsip_mwi.c
parent786c6d42efb702f790a59aa5789cd0c43d62d5c6 (diff)
res_pjsip_mwi.c: Eliminate a simple RAII_VAR.
Change-Id: Ib1843f81e826a6c760c424c88eb70c350d9d61da
Diffstat (limited to 'res/res_pjsip_mwi.c')
-rw-r--r--res/res_pjsip_mwi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 701f6fbcf..4e7301070 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -633,10 +633,10 @@ static struct mwi_subscription *mwi_create_subscription(
static struct mwi_subscription *mwi_subscribe_single(
struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub, const char *name)
{
- RAII_VAR(struct ast_sip_aor *, aor,
- ast_sip_location_retrieve_aor(name), ao2_cleanup);
+ struct ast_sip_aor *aor;
struct mwi_subscription *sub;
+ aor = ast_sip_location_retrieve_aor(name);
if (!aor) {
/*! I suppose it's possible for the AOR to disappear on us
* between accepting the subscription and sending the first
@@ -647,11 +647,12 @@ static struct mwi_subscription *mwi_subscribe_single(
return NULL;
}
- if (!(sub = mwi_create_subscription(endpoint, sip_sub))) {
- return NULL;
+ sub = mwi_create_subscription(endpoint, sip_sub);
+ if (sub) {
+ mwi_on_aor(aor, sub, 0);
}
- mwi_on_aor(aor, sub, 0);
+ ao2_ref(aor, -1);
return sub;
}