[Bug fortran/55469] memory leak on read with istat.ne.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55469 Matthias Krack changed: What|Removed |Added CC||matthias.krack at gmail dot ||com --- Comment #4 from Matthias Krack 2012-11-28 14:58:23 UTC --- Thanks Tobias, the fix you propose in comment 3 seems indeed to solve the problem for the test case of Joost as well as for the valgrind based regtest of the current CP2K development version in which this memory leak originally showed up.
[Bug fortran/55469] memory leak on read with istat.ne.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55469 --- Comment #5 from Matthias Krack 2012-11-29 10:16:06 UTC --- Memory leaks are still present for other choices of the string t. For instance t="." or t="./" is still causing memory leaks for the test case in comment 1 as detected by valgrind 3.8.1 for a patched (see comment 3) gcc version 4.7.3 20121129 (prerelease) (GCC) ==25497== 300 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==25497==at 0x4A0765C: malloc (vg_replace_malloc.c:270) ==25497==by 0x4C29208: _gfortrani_get_mem (memory.c:43) ==25497==by 0x4CDD799: push_char (list_read.c:78) ==25497==by 0x4CDE892: read_real (list_read.c:1408) ==25497==by 0x4CE0F86: _gfortrani_list_formatted_read (list_read.c:1876) It seems that the logic for the memory cleanup is still incomplete. Note, that the memory leaks appear only if the IOSTAT parameter is present in the READ statement.
[Bug fortran/55469] memory leak on read with istat.ne.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55469 --- Comment #7 from Matthias Krack 2012-11-29 11:12:56 UTC --- I also checked the more complete patch PR5469, but it shows still the memory leaks as described in comment 5 for the 4_7-branch. The same is true for the gcc trunk version.