# HG changeset patch # User Markus Bröker # Date 1239883067 -7200 # Node ID b2f1756c17ca90a2dd271568695f8e2148bfa6c3 # Parent 86b83a979d9e227090d8dd2fe50718d47b73486f [alpha_beta] Fix memory leaks I have used many mallocs and have not freed it. But there is still a read error which indicates another problem. committer: Markus Bröker diff --git a/alpha_beta.c b/alpha_beta.c --- a/alpha_beta.c +++ b/alpha_beta.c @@ -74,6 +74,7 @@ board[stack_end->data->target] = EMPTY; actual = stack_end->prev; + free (stack_end->data); free (stack_end); stack_end = actual; @@ -340,6 +341,7 @@ print (); if ((estimateFunction () * estimateFunction ()) == 2500) { + free (actual); return EXIT_SUCCESS; } @@ -348,6 +350,7 @@ } print (); + free (actual); return EXIT_SUCCESS; }