summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-18 22:19:27 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-18 22:19:27 +0000
commit4516dace8ad4d5efb44153a9bfe54a8e17bf5858 (patch)
treefd3e37aa3d34033b34b8ed61a0800230c47a3882 /libgfortran
parent975b0a2a9c18a381ed0304fa5b2748e7bd3675f1 (diff)
downloadgcc-4516dace8ad4d5efb44153a9bfe54a8e17bf5858.tar.gz
correct memory leaks in namelist code for derived types
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98352 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/io/list_read.c12
2 files changed, 17 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index f4716af402c..d0dc7f179e6 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-18 Paul Thomas <pault@gcc.gnu.org>
+
+ * io/list_read.c (nml_touch_nodes, nml_read_obj,
+ nml_get_obj_data): Fix memory leaks in code for derived types.
+
2005-04-11 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20950
@@ -16,11 +21,11 @@
2005-04-17 Paul Thomas <pault@gcc.gnu.org>
-* io/list_read.c (eat_separator): at_eol = 1 replaced(zapped at some time?).
+ * io/list_read.c (eat_separator): at_eol = 1 replaced
+ (zapped at some time?).
2005-04-17 Paul Thomas <pault@gcc.gnu.org>
-
PR libgfortran/12884
PR libgfortran/17285
PR libgfortran/18122
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index becf09edd06..bc592ddcc12 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1673,6 +1673,7 @@ nml_touch_nodes (namelist_info * nl)
else
break;
}
+ free_mem (ext_name);
return;
}
@@ -1914,10 +1915,16 @@ nml_read_obj (namelist_info * nl, index_type offset)
{
if (nml_read_obj (cmp, (index_type)(pdata - nl->mem_pos)) == FAILURE)
- return FAILURE;
+ {
+ free_mem (obj_name);
+ return FAILURE;
+ }
if (input_complete)
- return SUCCESS;
+ {
+ free_mem (obj_name);
+ return SUCCESS;
+ }
}
free_mem (obj_name);
@@ -2105,6 +2112,7 @@ get_name:
strcpy (ext_name, root_nl->var_name);
strcat (ext_name, saved_string);
nl = find_nml_node (ext_name);
+ free_mem (ext_name);
}
else
nl = find_nml_node (saved_string);