summaryrefslogtreecommitdiff
path: root/res/res_pjsip_send_to_voicemail.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-02-29 20:41:55 -0600
committerRichard Mudgett <rmudgett@digium.com>2016-03-01 20:09:32 -0600
commit75ec137e91d60795f8c85ab42ed134dd0bc07129 (patch)
tree50272492ac0bc50936d65a92279fe84014e3afc3 /res/res_pjsip_send_to_voicemail.c
parentd0b26c3133e831e915990fd806257d9ef07c508b (diff)
res_pjsip_send_to_voicemail.c: Fix off-nominal double channel unref.
* Fix double unref of other_party channel in off nominal path. * This is unlikely to be a real problem. However, for safety, in handle_incoming_request() keep the datastore ref with the other_party channel ref until we are finished with the other_party channel. Change-Id: I78f22547bf0bb99fb20814ceab75952bd857f821
Diffstat (limited to 'res/res_pjsip_send_to_voicemail.c')
-rw-r--r--res/res_pjsip_send_to_voicemail.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/res/res_pjsip_send_to_voicemail.c b/res/res_pjsip_send_to_voicemail.c
index 9d2b5b14b..cd0f05f27 100644
--- a/res/res_pjsip_send_to_voicemail.c
+++ b/res/res_pjsip_send_to_voicemail.c
@@ -160,12 +160,10 @@ static int handle_incoming_request(struct ast_sip_session *session, struct pjsip
sip_session_datastore->data = other_party;
if (ast_sip_session_add_datastore(session, sip_session_datastore)) {
- ast_channel_unref(other_party);
ao2_ref(sip_session_datastore, -1);
send_response(session, 500, rdata);
return -1;
}
- ao2_ref(sip_session_datastore, -1);
if (has_feature) {
pbx_builtin_setvar_helper(other_party, SEND_TO_VM_HEADER,
@@ -177,6 +175,7 @@ static int handle_incoming_request(struct ast_sip_session *session, struct pjsip
SEND_TO_VM_REDIRECT_VALUE);
}
+ ao2_ref(sip_session_datastore, -1);
return 0;
}