From f89515febdcfe06ea7e806dc9b7365e93539879d Mon Sep 17 00:00:00 2001 From: Maurizio Cingi Date: Tue, 24 Nov 2015 19:49:13 +0100 Subject: [PATCH] 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 --- src/output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output.c b/src/output.c index 0e18bb8..ced8c73 100755 --- a/src/output.c +++ b/src/output.c @@ -503,6 +503,7 @@ int savefinaloutput() ERRCODE(savetimestat(x,LINKHDR)); if (!errcode) Nperiods = 1; fclose(TmpOutFile); + TmpOutFile=NULL; free(x); }