From edf8e50ce806cf2d16fa78143bc3e6861aae0772 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 4 Apr 2012 20:14:27 -0700 Subject: [PATCH] use my{Malloc,Free} in model-checking code Also, fixes 'leak' where we forgot to free the main_thread. --- libthreads.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libthreads.cc b/libthreads.cc index 5a4c3a1..c0439ff 100644 --- a/libthreads.cc +++ b/libthreads.cc @@ -156,7 +156,7 @@ int main() model = new ModelChecker(); - main_thread = (struct thread *)malloc(sizeof(*main_thread)); + main_thread = (struct thread *)myMalloc(sizeof(*main_thread)); create_initial_thread(main_thread); model->add_system_thread(main_thread); @@ -167,6 +167,7 @@ int main() thread_wait_finish(); delete model; + myFree(main_thread); DEBUG("Exiting\n"); return 0; -- 2.34.1