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



             Bug #: 55469

           Summary: memory leak on read with istat.ne.0

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: joost.vandevond...@mat.ethz.ch





The following testcase leads to memory leaks with gfortran 4.5/4.6/4.7/4.8 (as

found by valgrind) 4.1 seems not to leak (but has a couple of warnings).



REAL :: z

INTEGER :: istat

CHARACTER(LEN=3) :: t

t="NVE"

READ (UNIT=t,FMT=*,IOSTAT=istat) z

END



note that istat.NE.0 in this case.



==37422== 300 bytes in 1 blocks are definitely lost in loss record 1 of 1

==37422==    at 0x4A057F4: calloc (vg_replace_malloc.c:593)

==37422==    by 0x4C298FF: _gfortrani_xcalloc (memory.c:56)

==37422==    by 0x4CE2A82: l_push_char.isra.2 (list_read.c:641)

==37422==    by 0x4CE3223: read_real (list_read.c:1634)

==37422==    by 0x4CE504E: _gfortrani_list_formatted_read (list_read.c:1895)

Reply via email to