From 6ba4379b1e1791a3841db7967ae92d1cbe8bd4fd Mon Sep 17 00:00:00 2001 From: yuqing Date: Fri, 6 Jul 2018 17:48:50 +0800 Subject: [PATCH] call func_free of annotation --- src/ini_file_reader.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ini_file_reader.c b/src/ini_file_reader.c index 6364733..e5780c6 100644 --- a/src/ini_file_reader.c +++ b/src/ini_file_reader.c @@ -226,7 +226,7 @@ static int iniAnnotationFuncShellExec(IniContext *context, char *param, logWarning("file: "__FILE__", line: %d, " "empty reply when exec: %s", __LINE__, param); } - pOutValue[count++] = trim_right(output); + pOutValue[count++] = fc_trim(output); return count; } @@ -317,7 +317,6 @@ static int iniAnnotationReplaceVars(IniContext *pContext, char *param, trim(name); name_len = strlen(name); if (name_len > 0) { - logInfo("name: %s(%d)", name, name_len); value = (char *)hash_find(set->vars, name, name_len); } else { value = NULL; @@ -972,7 +971,7 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) if (isAnnotation) { AnnotationMap *pAnnoMapBase; - AnnotationMap *pAnnoMap; + AnnotationMap *pAnnoMap = NULL; bool found; isAnnotation = 0; @@ -1079,6 +1078,11 @@ static int iniDoLoadItemsFromBuffer(char *content, IniContext *pContext) } } } + + if (pAnnoMap != NULL && pAnnoMap->func_free != NULL) + { + pAnnoMap->func_free(pItemValues, nItemCnt); + } continue; }