aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-21 01:41:03 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-21 01:41:03 +0000
commit13d544890d5d3f299ec34fa03467bc567acc1137 (patch)
tree88f4b34425f5c5cb2698dac11211de239f68dd0e
parenta5ba081914af100753bbe4c1eccc9a8c2b542fb2 (diff)
2016-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* io/transfer.c (finalize_transfer): Free format data in child procedures. (st_read_done, st_write_done): Don't free format hash table. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241392 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgfortran/ChangeLog10
-rw-r--r--libgfortran/io/transfer.c11
2 files changed, 16 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 9662df891f5..511458f89d3 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,10 +1,16 @@
+2016-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * io/transfer.c (finalize_transfer): Free format data in child
+ procedures. (st_read_done, st_write_done): Don't free format
+ hash table.
+
2016-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/48298
* io/io.h: Move size_used from dtp to unit structure. Add bool
has_size to unit structure.
- * read.c (read_x): Use has_size and size_used.
- * transfer.c (read_sf_internal,read_sf,read_block_form,
+ * io/read.c (read_x): Use has_size and size_used.
+ * io/transfer.c (read_sf_internal,read_sf,read_block_form,
read_block_form4): Likewise.
(data_transfer_init): If parent, initialize the size variables.
(finalize_transfer): Set the size variable using size_used in
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 1f46ca64cf1..0879ca7ae8c 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -3783,7 +3783,14 @@ finalize_transfer (st_parameter_dt *dtp)
}
if (dtp->u.p.current_unit && (dtp->u.p.current_unit->child_dtio > 0))
- return;
+ {
+ if (cf & IOPARM_DT_HAS_FORMAT)
+ {
+ free (dtp->u.p.fmt);
+ free (dtp->format);
+ }
+ return;
+ }
if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
*dtp->size = dtp->u.p.current_unit->size_used;
@@ -3972,7 +3979,6 @@ st_read_done (st_parameter_dt *dtp)
{
free (dtp->u.p.current_unit->filename);
dtp->u.p.current_unit->filename = NULL;
- free_format_hash_table (dtp->u.p.current_unit);
free (dtp->u.p.current_unit->s);
dtp->u.p.current_unit->s = NULL;
if (dtp->u.p.current_unit->ls)
@@ -4043,7 +4049,6 @@ st_write_done (st_parameter_dt *dtp)
{
free (dtp->u.p.current_unit->filename);
dtp->u.p.current_unit->filename = NULL;
- free_format_hash_table (dtp->u.p.current_unit);
free (dtp->u.p.current_unit->s);
dtp->u.p.current_unit->s = NULL;
if (dtp->u.p.current_unit->ls)