summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-02-06 01:44:31 -0800
committerKai Stevenson <kai@kaistevenson.com>2023-02-06 01:44:31 -0800
commit14a82b2a803b9cccbfecb6fac1b2a1d8fcd97c2a (patch)
treeffe05d39fe65ecd336a1da7694bbe5bbc3d155ed
parentdf22092a336543c0f6d2c605e0aa96df7d2ccae2 (diff)
added free calls for thread args
-rw-r--r--snake.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/snake.c b/snake.c
index 9af8df7..6b4201f 100644
--- a/snake.c
+++ b/snake.c
@@ -67,6 +67,8 @@ int main(int argc, char **argv) {
*cancellationToken = 1;
printf("Press any key to exit\n");
pthread_join(listenerID, NULL);
+ free(cancellationToken);
+ free((int*)lastInput);
return 0;
}
@@ -126,6 +128,8 @@ int main(int argc, char **argv) {
printf("\n%sYou died. Press any key to exit%s\n", RED, COLOR_RESET);
printf("\e[?25h");
pthread_join(listenerID, NULL);
+ free(cancellationToken);
+ free((int*)lastInput);
return 0;
}
void* get_dir_loop(void* threadArg) {