From b6c7daa80456f759d5f64be41492f565e7f05889 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Fri, 2 Nov 2007 13:17:48 +0000
Subject: [PATCH] Don't re-cache the filename, but check to see if it already
 exists Reported by: jamesgolovich Patch by: jamesgolovich Closes issue #11144

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/main/config.c b/main/config.c
index 88bfd8a5f0..e2f0a8dc48 100644
--- a/main/config.c
+++ b/main/config.c
@@ -818,6 +818,12 @@ static void config_cache_attribute(const char *configfile, enum config_cache_att
 
 	switch (attrtype) {
 	case ATTRIBUTE_INCLUDE:
+		AST_LIST_TRAVERSE(&cfmtime->includes, cfinclude, list) {
+			if (!strcmp(cfinclude->include, filename)) {
+				AST_LIST_UNLOCK(&cfmtime_head);
+				return;
+			}
+		}
 		cfinclude = ast_calloc(1, sizeof(*cfinclude) + strlen(filename) + 1);
 		if (!cfinclude) {
 			AST_LIST_UNLOCK(&cfmtime_head);
-- 
GitLab