diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2016-10-21 01:41:03 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2016-10-21 01:41:03 +0000 |
commit | bdff7e518b1f28d02ebf26662a31148a62295d83 (patch) | |
tree | 88f4b34425f5c5cb2698dac11211de239f68dd0e /libgfortran/io/transfer.c | |
parent | 2b1c40345d4b76c40fd676636a79176e8459e65b (diff) | |
download | gcc-bdff7e518b1f28d02ebf26662a31148a62295d83.zip gcc-bdff7e518b1f28d02ebf26662a31148a62295d83.tar.gz gcc-bdff7e518b1f28d02ebf26662a31148a62295d83.tar.bz2 |
transfer.c (finalize_transfer): Free format data in child procedures.
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.
From-SVN: r241392
Diffstat (limited to 'libgfortran/io/transfer.c')
-rw-r--r-- | libgfortran/io/transfer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 1f46ca6..0879ca7 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) |