From: N. Brouard Date: Fri, 24 Feb 2006 14:20:24 +0000 (+0000) Subject: (Module): Memory leaks checks with valgrind and: X-Git-Tag: imach-099s7~516 X-Git-Url: https://henry.ined.fr/git/?a=commitdiff_plain;h=748ce5b7c21413e47cf0d9b17d871f2f0158c801;p=.git (Module): Memory leaks checks with valgrind and: datafile was not closed, some imatrix were not freed and on matrix allocation too. --- diff --git a/src/imach.c b/src/imach.c index d013977..3fd8b54 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,9 @@ /* $Id$ $State$ $Log$ + Revision 1.112 2006/01/30 09:55:26 brouard + (Module): Back to gnuplot.exe instead of wgnuplot.exe + Revision 1.111 2006/01/25 20:38:18 brouard (Module): Lots of cleaning and bugs added (Gompertz) (Module): Comments can be added in data file. Missing date values @@ -3231,6 +3234,8 @@ To be simple, these graphs help to understand the significativity of each parame } free_ma3x(varpij,1,nlstate,1,nlstate+ndeath,(int) bage, (int)fage); free_matrix(mu,1,(nlstate+ndeath)*(nlstate+ndeath),(int) bage, (int)fage); + free_matrix(doldm,1,(nlstate)*(nlstate+ndeath),1,(nlstate)*(nlstate+ndeath)); + free_matrix(dnewm,1,(nlstate)*(nlstate+ndeath),1,npar); free_vector(xp,1,npar); fclose(ficresprob); fclose(ficresprobcov); @@ -4625,6 +4630,7 @@ int main(int argc, char *argv[]) i=i+1; } /* End loop reading data */ + fclose(fic); /* printf("ii=%d", ij); scanf("%d",i);*/ imx=i-1; /* Number of individuals */ @@ -4722,8 +4728,7 @@ int main(int argc, char *argv[]) printf("cptcovprod=%d ", cptcovprod); fprintf(ficlog,"cptcovprod=%d ", cptcovprod); - scanf("%d ",i); - fclose(fic);*/ + scanf("%d ",i);*/ /* if(mle==1){*/ if (weightopt != 1) { /* Maximisation without weights*/ @@ -5607,11 +5612,11 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf
\n",\ free_ma3x(probs,1,AGESUP,1,NCOVMAX, 1,NCOVMAX); } /* mle==-3 arrives here for freeing */ + free_matrix(prlim,1,nlstate,1,nlstate); free_matrix(pmmij,1,nlstate+ndeath,1,nlstate+ndeath); free_matrix(oldms, 1,nlstate+ndeath,1,nlstate+ndeath); free_matrix(newms, 1,nlstate+ndeath,1,nlstate+ndeath); free_matrix(savms, 1,nlstate+ndeath,1,nlstate+ndeath); - free_matrix(covar,0,NCOVMAX,1,n); free_matrix(matcov,1,npar,1,npar); /*free_vector(delti,1,npar);*/ @@ -5626,7 +5631,8 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf
\n",\ free_ivector(Tage,1,15); free_ivector(Tcode,1,100); - + free_imatrix(nbcode,0,NCOVMAX,0,NCOVMAX); + free_imatrix(codtab,1,100,1,10); fflush(fichtm); fflush(ficgp);