This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/55469] memory leak on read with istat.ne.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55469

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-11-26 10:23:54 UTC ---
Didn't help. The following should work. The crucial part is "free_line". At a
glance free_saved(dtp) (here and in comment 2) seems also to be sensible, but
one should read through the file to check that it is indeed correct - and to
find other places where free_line is missing.

--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1757,8 +1757,9 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
  bad_real:

+  free_line (dtp);
+  free_saved (dtp);
   if (nml_bad_return (dtp, c))
     return;

-  free_saved (dtp);
   if (c == EOF)
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]