[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] cex: fix miscellaneous leaks
From: |
Vincent Imbimbo |
Subject: |
[PATCH 5/7] cex: fix miscellaneous leaks |
Date: |
Thu, 21 May 2020 22:13:15 -0400 |
* src/counterexample.c: (unifying_counterexample) always free stage3result when
it exists.
* src/conflicts.c: (report_state_counterexamples) free leaked bitset.
* src/state-item.c: (prune_disabled_paths) free leaked queue.
---
src/conflicts.c | 1 +
src/counterexample.c | 7 +++----
src/state-item.c | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/conflicts.c b/src/conflicts.c
index b6cccd76..f007e204 100644
--- a/src/conflicts.c
+++ b/src/conflicts.c
@@ -677,6 +677,7 @@ report_state_counterexamples (const state *s)
}
}
}
+ bitset_free (conf);
}
}
}
diff --git a/src/counterexample.c b/src/counterexample.c
index 0909652c..e87d5d2b 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -1110,10 +1110,7 @@ cex_search_end:;
// If a search state from Stage 3 is available, use it
// to construct a more compact nonunifying counterexample.
if (stage3result)
- {
- cex = complete_diverging_examples (stage3result, next_sym);
- search_state_free (stage3result);
- }
+ cex = complete_diverging_examples (stage3result, next_sym);
// Otherwise, construct a nonunifying counterexample that
// begins from the start state using the shortest
// lookahead-sensitive path to the reduce item.
@@ -1122,6 +1119,8 @@ cex_search_end:;
}
gl_list_free (ssb_queue);
hash_free (visited);
+ if (stage3result)
+ search_state_free (stage3result);
return cex;
}
diff --git a/src/state-item.c b/src/state-item.c
index 13362ec0..62d2d210 100644
--- a/src/state-item.c
+++ b/src/state-item.c
@@ -449,6 +449,7 @@ prune_disabled_paths (void)
}
}
}
+ gl_list_free (queue);
}
}
}
--
2.20.1 (Apple Git-117)
- [PATCH 0/7] Fixing all cex leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 1/7] cex: dervation reference counting, Vincent Imbimbo, 2020/05/21
- [PATCH 2/7] cex: fix parse state leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 3/7] cex: fix lssi leaks, Vincent Imbimbo, 2020/05/21
- [PATCH 4/7] cex: fix counterexample leak, Vincent Imbimbo, 2020/05/21
- [PATCH 5/7] cex: fix miscellaneous leaks,
Vincent Imbimbo <=
- [PATCH 6/7] cex: fix bad reference counting, Vincent Imbimbo, 2020/05/21
- [PATCH 7/7] cex: replace state-item data structures, Vincent Imbimbo, 2020/05/21
- Re: [PATCH 0/7] Fixing all cex leaks, Akim Demaille, 2020/05/22