summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-11-17 12:59:32 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-11-17 12:59:32 -0600
commit6c10d30d0ec2c1c9effa0bd2f279d913aeaaee56 (patch)
treec315382e9f7ac042d01b2d8229fad1c6f325aadd
parent0843e6043e371a4fd8c4ac29f542a54df585f572 (diff)
parentf62b642fe32d06ca24b4a0de94543279fe918d0a (diff)
Merge "res/res_pjsip: Fix off nominal crash with requests that fail and have a timer" into 13
-rw-r--r--res/res_pjsip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index babbe7aaa..8e99c55d4 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3155,9 +3155,11 @@ static pj_status_t endpt_send_request(struct ast_sip_endpoint *endpoint,
char errmsg[PJ_ERR_MSG_SIZE];
if (timeout > 0) {
- pj_timer_heap_cancel_if_active(pjsip_endpt_get_timer_heap(endpt),
+ int timers_cancelled = pj_timer_heap_cancel_if_active(pjsip_endpt_get_timer_heap(endpt),
req_wrapper->timeout_timer, TIMER_INACTIVE);
- ao2_ref(req_wrapper, -1);
+ if (timers_cancelled > 0) {
+ ao2_ref(req_wrapper, -1);
+ }
}
/* Complain of failure to send the request. */