aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2016-02-17 16:48:57 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2016-02-17 16:48:57 +0000
commitd64602b7558441d2d3f743a2464cf41e052e6d39 (patch)
tree010e48eb8a0f8e7b4196d7c6d0f1433913fdd672 /libgfortran/io
parent6cadc065bc3f83576d551812b953f9e97b826d48 (diff)
2016-02-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/69651 * io/list_read.c (push_char4): Fix the pointer usage for xrealloc. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@233500 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/list_read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index fcd4b6e25e9..bebdd8cf301 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -119,7 +119,10 @@ push_char4 (st_parameter_dt *dtp, int c)
if (dtp->u.p.saved_used >= dtp->u.p.saved_length)
{
dtp->u.p.saved_length = 2 * dtp->u.p.saved_length;
- p = xrealloc (p, dtp->u.p.saved_length * sizeof (gfc_char4_t));
+ dtp->u.p.saved_string =
+ xrealloc (dtp->u.p.saved_string,
+ dtp->u.p.saved_length * sizeof (gfc_char4_t));
+ p = (gfc_char4_t *) dtp->u.p.saved_string;
}
p[dtp->u.p.saved_used++] = c;