re PR libfortran/27360 (Memory leaks when reading logicals)
2006-04-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/27360 * io/list_read.c (read_logical): Free line_buffer and free saved. From-SVN: r113388
This commit is contained in:
parent
aedb974e2c
commit
4e72e1c5a2
@ -1,3 +1,9 @@
|
||||
2006-04-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/27360
|
||||
|
||||
* io/list_read.c (read_logical): Free line_buffer and free saved.
|
||||
|
||||
2006-04-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/27304
|
||||
|
@ -652,6 +652,7 @@ read_logical (st_parameter_dt *dtp, int length)
|
||||
dtp->u.p.item_count = 0;
|
||||
dtp->u.p.line_buffer_enabled = 0;
|
||||
set_integer ((int *) dtp->u.p.value, v, length);
|
||||
free_line (dtp);
|
||||
|
||||
return;
|
||||
|
||||
@ -689,25 +690,27 @@ read_logical (st_parameter_dt *dtp, int length)
|
||||
|
||||
bad_logical:
|
||||
|
||||
free_line (dtp);
|
||||
|
||||
if (nml_bad_return (dtp, c))
|
||||
return;
|
||||
|
||||
eat_line (dtp);
|
||||
free_saved (dtp);
|
||||
if (dtp->u.p.line_buffer != NULL)
|
||||
free_mem (dtp->u.p.line_buffer);
|
||||
st_sprintf (message, "Bad logical value while reading item %d",
|
||||
dtp->u.p.item_count);
|
||||
generate_error (&dtp->common, ERROR_READ_VALUE, message);
|
||||
return;
|
||||
|
||||
logical_done:
|
||||
|
||||
|
||||
dtp->u.p.item_count = 0;
|
||||
dtp->u.p.line_buffer_enabled = 0;
|
||||
dtp->u.p.saved_type = BT_LOGICAL;
|
||||
dtp->u.p.saved_length = length;
|
||||
set_integer ((int *) dtp->u.p.value, v, length);
|
||||
free_saved (dtp);
|
||||
free_line (dtp);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user