memory wrong free in global vars used for configuration storage

This commit is contained in:
Laurent Thomas
2021-02-18 22:23:31 +01:00
parent c93482c4c6
commit 11a318170e
4 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -331,9 +331,10 @@ void end_configmodule(void) {
printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs);
for(int i=0; i<cfgptr->numptrs ; i++) {
if (cfgptr->ptrs[i] != NULL) {
if (cfgptr->ptrs[i] != NULL && cfgptr->ptrsAllocated[i] == true) {
free(cfgptr->ptrs[i]);
cfgptr->ptrs[i]=NULL;
cfgptr->ptrsAllocated[i] = false;
}
}