diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-02-06 01:44:31 -0800 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-02-06 01:44:31 -0800 |
| commit | 14a82b2a803b9cccbfecb6fac1b2a1d8fcd97c2a (patch) | |
| tree | ffe05d39fe65ecd336a1da7694bbe5bbc3d155ed | |
| parent | df22092a336543c0f6d2c605e0aa96df7d2ccae2 (diff) | |
added free calls for thread args
| -rw-r--r-- | snake.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) { |
