added TmpOutFile=NULL; after closing TmpOutFile

In case of [TIMES] Statistic not equal NONE (see page 174 of Epanet2 users manual) ENclose() function tries to close TmpOutFile again giving a "double free or corruption" error
This commit is contained in:
Maurizio Cingi
2015-11-24 19:49:13 +01:00
parent 08937fc838
commit f89515febd

View File

@@ -503,6 +503,7 @@ int savefinaloutput()
ERRCODE(savetimestat(x,LINKHDR));
if (!errcode) Nperiods = 1;
fclose(TmpOutFile);
TmpOutFile=NULL;
free(x);
}