From 3959f2bfae450b745e46e20ea02a9cfe2543ea0a Mon Sep 17 00:00:00 2001 From: Emman Mensdorf Date: Thu, 8 Feb 2024 11:43:21 +0100 Subject: [PATCH] =?UTF-8?q?Puzzelbrettspeicher=20erg=C3=A4nzt,=20Emman=20M?= =?UTF-8?q?ensdorf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/schach_in_ein_puzzle/PuzzleI.c | 12 ++++++++++++ src/schach_in_ein_puzzle/PuzzleI.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/schach_in_ein_puzzle/PuzzleI.c b/src/schach_in_ein_puzzle/PuzzleI.c index d927864..8d6f5d8 100644 --- a/src/schach_in_ein_puzzle/PuzzleI.c +++ b/src/schach_in_ein_puzzle/PuzzleI.c @@ -59,4 +59,16 @@ void print_Puzzlebrett(char** Brett) { printf("\n"); } printf("\n"); +} + +void Puzzlebrettspeicher_freigeben(char** Brett) { + if (Brett == NULL) { + return; + } + + for (int i = 0; i < 8; i++) { + free(Brett[i]); + } + + free(Brett); } \ No newline at end of file diff --git a/src/schach_in_ein_puzzle/PuzzleI.h b/src/schach_in_ein_puzzle/PuzzleI.h index 867c5cd..112a9a2 100644 --- a/src/schach_in_ein_puzzle/PuzzleI.h +++ b/src/schach_in_ein_puzzle/PuzzleI.h @@ -5,5 +5,6 @@ char** Puzzlebrett_erstellen(); void print_Puzzlebrett(char** Brett); +void Puzzlebrettspeicher_freigeben(char** Brett); #endif // PUZZLEI_H \ No newline at end of file