correct memory leaks in namelist code for derived types

From-SVN: r98352
This commit is contained in:
Paul Thomas 2005-04-18 22:19:27 +00:00
parent 8a731165af
commit 883dd42959
2 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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);