]> henry.ined.fr Git - .git/commitdiff
(Module): Memory leaks checks with valgrind and:
authorN. Brouard <brouard@ined.fr>
Fri, 24 Feb 2006 14:20:24 +0000 (14:20 +0000)
committerN. Brouard <brouard@ined.fr>
Fri, 24 Feb 2006 14:20:24 +0000 (14:20 +0000)
datafile was not closed, some imatrix were not freed and on matrix
allocation too.

src/imach.c

index d0139777091d68fdaea9bcc105513baf944a3357..3fd8b54b0933bcb47f76614be05a585083b3bc9d 100644 (file)
@@ -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<br>\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<br>\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);