mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 16:20:37 +00:00
Merge "res_pjsip_mwi: potential double unref, and potential unwanted double link" into 13
This commit is contained in:
@@ -1223,6 +1223,13 @@ static int create_unsolicited_mwi_subscriptions(struct ast_sip_endpoint *endpoin
|
|||||||
if (!aggregate_sub) {
|
if (!aggregate_sub) {
|
||||||
return 0; /* No MWI aggregation for you */
|
return 0; /* No MWI aggregation for you */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Just in case we somehow get in the position of recreating with no previous
|
||||||
|
* aggregate object, set recreate to false here in order to allow the new
|
||||||
|
* object to be linked into the container below
|
||||||
|
*/
|
||||||
|
recreate = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1266,13 +1273,13 @@ static int create_unsolicited_mwi_subscriptions(struct ast_sip_endpoint *endpoin
|
|||||||
|
|
||||||
if (aggregate_sub) {
|
if (aggregate_sub) {
|
||||||
if (ao2_container_count(aggregate_sub->stasis_subs)) {
|
if (ao2_container_count(aggregate_sub->stasis_subs)) {
|
||||||
ao2_link_flags(unsolicited_mwi, aggregate_sub, OBJ_NOLOCK);
|
/* Only link if we're dealing with a new aggregate object */
|
||||||
|
if (!recreate) {
|
||||||
|
ao2_link_flags(unsolicited_mwi, aggregate_sub, OBJ_NOLOCK);
|
||||||
|
}
|
||||||
if (send_now && sub_added) {
|
if (send_now && sub_added) {
|
||||||
send_notify(aggregate_sub, NULL, 0);
|
send_notify(aggregate_sub, NULL, 0);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* No stasis subscriptions then no MWI data to aggregate */
|
|
||||||
ao2_ref(aggregate_sub, -1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user