--- imach/src/imach.c 2006/01/30 09:55:26 1.112 +++ imach/src/imach.c 2006/02/24 14:20:24 1.113 @@ -1,6 +1,11 @@ -/* $Id: imach.c,v 1.112 2006/01/30 09:55:26 brouard Exp $ +/* $Id: imach.c,v 1.113 2006/02/24 14:20:24 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.113 2006/02/24 14:20:24 brouard + (Module): Memory leaks checks with valgrind and: + datafile was not closed, some imatrix were not freed and on matrix + allocation too. + Revision 1.112 2006/01/30 09:55:26 brouard (Module): Back to gnuplot.exe instead of wgnuplot.exe @@ -292,11 +297,11 @@ extern int errno; #define ODIRSEPARATOR '/' #endif -/* $Id: imach.c,v 1.112 2006/01/30 09:55:26 brouard Exp $ */ +/* $Id: imach.c,v 1.113 2006/02/24 14:20:24 brouard Exp $ */ /* $State: Exp $ */ char version[]="Imach version 0.98b, January 2006, INED-EUROREVES "; -char fullversion[]="$Revision: 1.112 $ $Date: 2006/01/30 09:55:26 $"; +char fullversion[]="$Revision: 1.113 $ $Date: 2006/02/24 14:20:24 $"; int erreur, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ int nvar; int cptcovn=0, cptcovage=0, cptcoveff=0,cptcov; @@ -3234,6 +3239,8 @@ To be simple, these graphs help to under } 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); @@ -4628,6 +4635,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 */ @@ -4725,8 +4733,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*/ @@ -5610,11 +5617,11 @@ Interval (in months) between two waves: 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);*/ @@ -5629,7 +5636,8 @@ Interval (in months) between two waves: 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);