From 7b280e7ccf326de80b183c4fe305b5ecfaa2094a Mon Sep 17 00:00:00 2001
From: Sebastien Duthil <sduthil@wazo.community>
Date: Fri, 3 Feb 2017 16:26:23 -0500
Subject: [PATCH] res_ari: fix memory leak for channelvars

In ari.conf, when setting the option channelvars, every Stasis channel
snapshot would create a list of variable/value that would not be freed
when the snapshot is freed, resulting in a often-recurring memory
leak.

ASTERISK-26767 #close

Change-Id: Ia37dd9d68063d7f879193df02ede293e5ded716d
---
 main/stasis_channels.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/main/stasis_channels.c b/main/stasis_channels.c
index 4897af89e7..dd71b86512 100644
--- a/main/stasis_channels.c
+++ b/main/stasis_channels.c
@@ -195,6 +195,7 @@ static void channel_snapshot_dtor(void *obj)
 
 	ast_string_field_free_memory(snapshot);
 	ao2_cleanup(snapshot->manager_vars);
+	ao2_cleanup(snapshot->ari_vars);
 }
 
 struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *chan)
-- 
GitLab