diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2016-02-17 16:48:57 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2016-02-17 16:48:57 +0000 |
commit | efea09f21b6a53247987de2428b963fd1ccd6789 (patch) | |
tree | 010e48eb8a0f8e7b4196d7c6d0f1433913fdd672 /libgfortran/io | |
parent | 1bed93e4655e4d95eb69c0fb6286e178ef89acea (diff) | |
download | gcc-efea09f21b6a53247987de2428b963fd1ccd6789.zip gcc-efea09f21b6a53247987de2428b963fd1ccd6789.tar.gz gcc-efea09f21b6a53247987de2428b963fd1ccd6789.tar.bz2 |
re PR libfortran/69651 ([6 Regession] Usage of unitialized pointer io/list_read.c)
2016-02-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/69651
* io/list_read.c (push_char4): Fix the pointer usage for xrealloc.
From-SVN: r233500
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/list_read.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index fcd4b6e..bebdd8c 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; |