]> git.saurik.com Git - bison.git/blobdiff - src/main.c
Fix push parsing memory leak reported by Brandon Lucia at
[bison.git] / src / main.c
index 84b2566f48945001c3252c055b58c1d7a7ab0913..8463608360f942697834a705786417934f624472 100644 (file)
@@ -116,11 +116,12 @@ main (int argc, char *argv[])
   timevar_push (TV_CONFLICTS);
   conflicts_solve ();
   {
-    state_number old_to_new[nstates];
+    state_number *old_to_new = xnmalloc (nstates, sizeof *old_to_new);
     state_number nstates_old = nstates;
     state_remove_unreachable_states (old_to_new);
     lalr_update_state_numbers (old_to_new, nstates_old);
     conflicts_update_state_numbers (old_to_new, nstates_old);
+    free (old_to_new);
   }
   conflicts_print ();
   timevar_pop (TV_CONFLICTS);