mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
res_pjsip_mwi.c: Eliminate a simple RAII_VAR.
Change-Id: Ib1843f81e826a6c760c424c88eb70c350d9d61da
This commit is contained in:
@@ -633,10 +633,10 @@ static struct mwi_subscription *mwi_create_subscription(
|
|||||||
static struct mwi_subscription *mwi_subscribe_single(
|
static struct mwi_subscription *mwi_subscribe_single(
|
||||||
struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub, const char *name)
|
struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub, const char *name)
|
||||||
{
|
{
|
||||||
RAII_VAR(struct ast_sip_aor *, aor,
|
struct ast_sip_aor *aor;
|
||||||
ast_sip_location_retrieve_aor(name), ao2_cleanup);
|
|
||||||
struct mwi_subscription *sub;
|
struct mwi_subscription *sub;
|
||||||
|
|
||||||
|
aor = ast_sip_location_retrieve_aor(name);
|
||||||
if (!aor) {
|
if (!aor) {
|
||||||
/*! I suppose it's possible for the AOR to disappear on us
|
/*! I suppose it's possible for the AOR to disappear on us
|
||||||
* between accepting the subscription and sending the first
|
* between accepting the subscription and sending the first
|
||||||
@@ -647,11 +647,12 @@ static struct mwi_subscription *mwi_subscribe_single(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sub = mwi_create_subscription(endpoint, sip_sub))) {
|
sub = mwi_create_subscription(endpoint, sip_sub);
|
||||||
return NULL;
|
if (sub) {
|
||||||
|
mwi_on_aor(aor, sub, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
mwi_on_aor(aor, sub, 0);
|
ao2_ref(aor, -1);
|
||||||
return sub;
|
return sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user