summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/res_pjsip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 34edc8ca5..8ecdb0382 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3578,7 +3578,7 @@ int ast_sip_failover_request(pjsip_tx_data *tdata)
{
pjsip_via_hdr *via;
- if (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1) {
+ if (!tdata->dest_info.addr.count || (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1)) {
/* No more addresses to try */
return 0;
}