[PATCH 6/7] cex: fix bad reference counting

Vincent Imbimbo <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
* src/counterexample.c: (si_bfs_free) fix reference_count decrementing.
---
 src/counterexample.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/counterexample.c b/src/counterexample.c
index e87d5d2b..6201d9f3 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -158,13 +158,10 @@ si_bfs_free (si_bfs_node *n)
 {
   if (n == NULL)
     return;
+  --n->reference_count;
   if (n->reference_count == 0)
     {
-      if (n->parent)
-        {
-          --n->parent->reference_count;
-          si_bfs_free (n->parent);
-        }
+      si_bfs_free (n->parent);
       free (n);
     }
 }
-- 
2.20.1 (Apple Git-117)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.