This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55469] memory leak on read with istat.ne.0
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Nov 2012 10:23:54 +0000
- Subject: [Bug fortran/55469] memory leak on read with istat.ne.0
- Auto-submitted: auto-generated
- References: <bug-55469-4@http.gcc.gnu.org/bugzilla/>
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)
{