From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15046 invoked by alias); 29 Nov 2012 10:16:24 -0000 Received: (qmail 14957 invoked by uid 48); 29 Nov 2012 10:16:07 -0000 From: "matthias.krack at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55469] memory leak on read with istat.ne.0 Date: Thu, 29 Nov 2012 10:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matthias.krack at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02857.txt.bz2 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.