This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55469] New: memory leak on read with istat.ne.0
- From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Nov 2012 07:57:34 +0000
- Subject: [Bug fortran/55469] New: memory leak on read with istat.ne.0
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: Joost.VandeVondele@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)