bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/7] cex: fix lssi leaks


From: Vincent Imbimbo
Subject: [PATCH 3/7] cex: fix lssi leaks
Date: Thu, 21 May 2020 22:13:13 -0400

* src/lssi.c (shortest_path_from_start): free the root of 
shortest_path_from_start search.
free eligible bitset.
---
 src/lssi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lssi.c b/src/lssi.c
index 95261b3f..293daafb 100644
--- a/src/lssi.c
+++ b/src/lssi.c
@@ -159,9 +159,9 @@ shortest_path_from_start (state_item_number target, 
symbol_number next_sym)
   bitset il = bitset_create (nsyms, BITSET_FIXED);
   bitset_set (il, 0);
   lssi *init = new_lssi (0, NULL, il, true);
-  gl_list_t queue = gl_list_create (GL_LINKED_LIST, NULL, NULL,
-                                    NULL,
-                                    true, 1, (const void **) &init);
+  gl_list_t queue = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL,
+                                          NULL, true);
+  append_lssi (init, visited, queue);
   // breadth-first search
   bool finished = false;
   lssi *n;
@@ -234,6 +234,8 @@ shortest_path_from_start (state_item_number target, 
symbol_number next_sym)
             bitset_free (lookahead);
         }
     }
+
+  bitset_free (eligible);
   if (!finished)
     {
       gl_list_free (queue);
-- 
2.20.1 (Apple Git-117)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]