From: Brian Norris Date: Thu, 5 Apr 2012 03:14:27 +0000 (-0700) Subject: use my{Malloc,Free} in model-checking code X-Git-Tag: pldi2013~567 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=edf8e50ce806cf2d16fa78143bc3e6861aae0772;p=model-checker.git use my{Malloc,Free} in model-checking code Also, fixes 'leak' where we forgot to free the main_thread. --- 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;