summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/list_read.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c8ecbfcc07e..90537156703 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 0d1969b5348..ab3965d5f58 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -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);
}