aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/lock.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2005-04-17 20:09:37 +0000
committerPaul Thomas <pault@gcc.gnu.org>2005-04-17 20:09:37 +0000
commit29dc5138c3af990d84d312ac52954021b0ac8c3c (patch)
treed9306eebf9c2dd03d14aa1b070d6756da7970d6f /libgfortran/io/lock.c
parent3f620b5f2ba5930bf574d0b005078f1f7e8497ae (diff)
downloadgcc-29dc5138c3af990d84d312ac52954021b0ac8c3c.zip
gcc-29dc5138c3af990d84d312ac52954021b0ac8c3c.tar.gz
gcc-29dc5138c3af990d84d312ac52954021b0ac8c3c.tar.bz2
re PR fortran/17472 ([4.0 only] namelist does not handle arrays)
------------------------------------------------------------------- From-SVN: r98287
Diffstat (limited to 'libgfortran/io/lock.c')
-rw-r--r--libgfortran/io/lock.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c
index 21d04d7..d85c9b8 100644
--- a/libgfortran/io/lock.c
+++ b/libgfortran/io/lock.c
@@ -1,5 +1,5 @@
/* Thread/recursion locking
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org> and Andy Vaught
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -73,20 +73,28 @@ library_end (void)
g.in_library = 0;
filename = NULL;
line = 0;
-
t = ioparm.library_return;
+
+ /* Delete the namelist, if it exists. */
+
if (ionml != NULL)
{
t1 = ionml;
while (t1 != NULL)
- {
- t2 = t1;
- t1 = t1->next;
- free_mem (t2);
- }
+ {
+ t2 = t1;
+ t1 = t1->next;
+ free_mem (t2->var_name);
+ if (t2->var_rank)
+ {
+ free_mem (t2->dim);
+ free_mem (t2->ls);
+ }
+ free_mem (t2);
+ }
}
-
ionml = NULL;
+
memset (&ioparm, '\0', sizeof (ioparm));
ioparm.library_return = t;
}