+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
}
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;
{
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)
{
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)