[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 <mbroeker@largo.homelinux.org>
--- 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;
}