bug fixed for set->vars and set->offset

pull/37/head
yuqing 2018-07-06 18:48:46 +08:00
parent 6ba4379b1e
commit 0005b1dc08
1 changed files with 2 additions and 1 deletions

View File

@ -279,7 +279,7 @@ static int iniAnnotationReplaceVars(IniContext *pContext, char *param,
} }
set = iniGetVars(pContext); set = iniGetVars(pContext);
if (set == NULL) { if (set == NULL || set->vars == NULL) {
logWarning("file: "__FILE__", line: %d, " logWarning("file: "__FILE__", line: %d, "
"NO set directives before, set value to %s", "NO set directives before, set value to %s",
__LINE__, param); __LINE__, param);
@ -2453,6 +2453,7 @@ void iniFreeContext(IniContext *pContext)
hash_destroy(set->vars); hash_destroy(set->vars);
free(set->vars); free(set->vars);
set->vars = NULL; set->vars = NULL;
set->offset = 0;
} }
iniFreeDynamicContent(pContext); iniFreeDynamicContent(pContext);
} }