From: Janus Weil Date: Fri, 27 Aug 2010 21:50:47 +0000 (+0200) Subject: re PR fortran/45432 (gfortran.dg/allocate_alloc_opt_9.f90: Segfault due to invalid... X-Git-Tag: releases/gcc-4.6.0~4809 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b052cbd0cd1c191def281819a3b29ebdf1f635b4;p=thirdparty%2Fgcc.git re PR fortran/45432 (gfortran.dg/allocate_alloc_opt_9.f90: Segfault due to invalid FREE) 2010-08-27 Janus Weil PR fortran/45432 * match.c (gfc_match_allocate): Avoid double free on error. From-SVN: r163599 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b98e37c8c88e..24c3e7aa28ea 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2010-08-27 Janus Weil + + PR fortran/45432 + * match.c (gfc_match_allocate): Avoid double free on error. + 2010-08-27 Francois-Xavier Coudert PR fortran/32049 diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 7c0dfc7478d7..47cd8d6be936 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2955,6 +2955,7 @@ alloc_opt_list: } stat = tmp; + tmp = NULL; saw_stat = true; if (gfc_check_do_variable (stat->symtree)) @@ -2981,6 +2982,7 @@ alloc_opt_list: } errmsg = tmp; + tmp = NULL; saw_errmsg = true; if (gfc_match_char (',') == MATCH_YES) @@ -3019,6 +3021,7 @@ alloc_opt_list: } source = tmp; + tmp = NULL; saw_source = true; if (gfc_match_char (',') == MATCH_YES) @@ -3050,6 +3053,7 @@ alloc_opt_list: } mold = tmp; + tmp = NULL; saw_mold = true; mold->mold = 1;