X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcontext.c;h=c86a595d8c79be86b07db026024c476080d3adcf;hp=218da24abb541a0a45d012650f51fa46550822e0;hb=e8a409b21cb50f5931ab02ce6ab4f4406be94394;hpb=d3171526ab7658114cac4ebe1098af4b038e576e diff --git a/src/context.c b/src/context.c index 218da24..c86a595 100644 --- a/src/context.c +++ b/src/context.c @@ -184,7 +184,7 @@ void PSI_ContextBuild(PSI_Context *C, const char *paths) { int i, n; char *sep = NULL, *cpy = strdup(paths), *ptr = cpy; - struct dirent **entries = NULL; + struct dirent **entries; do { sep = strchr(ptr, ':'); @@ -193,6 +193,7 @@ void PSI_ContextBuild(PSI_Context *C, const char *paths) *sep = 0; } + entries = NULL; n = php_scandir(ptr, &entries, psi_select_dirent, alphasort); if (n > 0) { @@ -341,6 +342,12 @@ void PSI_ContextDtor(PSI_Context *C) } free(C->structs); } + if (C->unions) { + if (C->unions->list) { + free(C->unions->list); + } + free(C->unions); + } if (C->enums) { if (C->enums->list) { free(C->enums->list);