aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-10-07 21:30:50 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-10-07 21:30:50 +0000
commit5615e8cdcefe4c702cd8e79fccadf4bf1b9237f5 (patch)
treeb7ea43ee8fbb0688523cec944bf0d9d33a0978bf /libgfortran/io
parentadd2402ef09ed864788f5501ad8bfc54fd48913b (diff)
downloadgcc-5615e8cdcefe4c702cd8e79fccadf4bf1b9237f5.zip
gcc-5615e8cdcefe4c702cd8e79fccadf4bf1b9237f5.tar.gz
gcc-5615e8cdcefe4c702cd8e79fccadf4bf1b9237f5.tar.bz2
transfer.c (finalize_transfer): Free internal streams.
* io/transfer.c (finalize_transfer): Free internal streams. * io/unix.c (mem_close): Free stream object. From-SVN: r88709
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/transfer.c6
-rw-r--r--libgfortran/io/unix.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 70a41fc..ceff76f 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1349,7 +1349,8 @@ next_record (int done)
/* Finalize the current data transfer. For a nonadvancing transfer,
- this means advancing to the next record. */
+ this means advancing to the next record. For internal units close the
+ steam associated with the unit. */
static void
finalize_transfer (void)
@@ -1392,6 +1393,9 @@ finalize_transfer (void)
}
sfree (current_unit->s);
+
+ if (is_internal_unit ())
+ sclose (current_unit->s);
}
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index e55966b..c8b18fc 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -811,6 +811,7 @@ mem_truncate (unix_stream * s)
static try
mem_close (unix_stream * s)
{
+ free_mem (s);
return SUCCESS;
}