From 79bf56c78ae1715a6e8948eedd87cd1e2665c4a8 Mon Sep 17 00:00:00 2001
From: Corey Farrell <git@cfware.com>
Date: Mon, 15 Jun 2015 17:40:54 -0400
Subject: [PATCH] func_pjsip_aor: Fix leaked contact from iterator.

ASTERISK-25162 #close

Change-Id: Id79aa3c6fe490016ee98efc97ac4c1d3f461f97e
---
 funcs/func_pjsip_aor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/funcs/func_pjsip_aor.c b/funcs/func_pjsip_aor.c
index e44ee946ba..47b9ad62e3 100644
--- a/funcs/func_pjsip_aor.c
+++ b/funcs/func_pjsip_aor.c
@@ -135,6 +135,8 @@ static int pjsip_aor_function_read(struct ast_channel *chan,
 
 			ast_str_append(buf, len, "%s", ast_sorcery_object_get_id(contact));
 			first = 0;
+
+			ao2_ref(contact, -1);
 		}
 		ao2_iterator_destroy(&i);
 	} else {
-- 
GitLab