aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-04-30 03:19:37 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-04-30 03:19:37 +0000
commit4e72e1c5a2cdef4e9b123cfa544e7fe78c92eda2 (patch)
treee68b4424e5f3dc50a2b26fc763cbeef380fb27c1 /libgfortran
parentaedb974e2c35a0ab679ce7d84286dd34c490f324 (diff)
downloadgcc-4e72e1c5a2cdef4e9b123cfa544e7fe78c92eda2.zip
gcc-4e72e1c5a2cdef4e9b123cfa544e7fe78c92eda2.tar.gz
gcc-4e72e1c5a2cdef4e9b123cfa544e7fe78c92eda2.tar.bz2
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
Diffstat (limited to 'libgfortran')
-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 c8ecbfc..9053715 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 0d1969b..ab3965d 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);
}