OSDN Git Service

2010-08-27 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Aug 2010 21:50:47 +0000 (21:50 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Aug 2010 21:50:47 +0000 (21:50 +0000)
PR fortran/45432
* match.c (gfc_match_allocate): Avoid double free on error.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163599 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/match.c

index b98e37c..24c3e7a 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-27  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/45432
+       * match.c (gfc_match_allocate): Avoid double free on error.
+
 2010-08-27  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/32049
index 7c0dfc7..47cd8d6 100644 (file)
@@ -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;