From 52fe5fe2c82a061eb049689dcaf50a5fe7253e3c Mon Sep 17 00:00:00 2001
From: Corey Farrell <git@cfware.com>
Date: Wed, 15 Aug 2018 12:12:49 -0400
Subject: [PATCH] res_pjsip: Fix leak in pjsip_options.

sip_options_get_endpoint_state_compositor_state leaked a reference to
the first available endpoint state compositor that was found.

Change-Id: Idb6be19f7219b6eed1dfb19c1e740dd40cb3fdc7
---
 res/res_pjsip/pjsip_options.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 5eaf9e8fd4..eb84c1b36b 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -565,6 +565,7 @@ static enum ast_endpoint_state sip_options_get_endpoint_state_compositor_state(
 	for (; (aor_status = ao2_iterator_next(&it_aor_statuses)); ao2_ref(aor_status, -1)) {
 		if (aor_status->available) {
 			state = AST_ENDPOINT_ONLINE;
+			ao2_ref(aor_status, -1);
 			break;
 		}
 	}
-- 
GitLab