diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-17 20:09:37 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-17 20:09:37 +0000 |
commit | fc2a7c2711d61197795e86f34a978af6f71d8a34 (patch) | |
tree | d9306eebf9c2dd03d14aa1b070d6756da7970d6f /libgfortran/io/lock.c | |
parent | 7955d282cbbe4d439c02275604bb04500bffba3c (diff) | |
download | gcc-fc2a7c2711d61197795e86f34a978af6f71d8a34.tar.gz |
-------------------------------------------------------------------
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/lock.c')
-rw-r--r-- | libgfortran/io/lock.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c index 21d04d720ac..d85c9b8c93f 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; } |