From e3074a479d9ae37959be212765c7c85510709e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vasi=C4=BE?= Date: Tue, 26 Apr 2022 21:20:57 +0200 Subject: [PATCH] domaca_uloha_7 --- du7/snake.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/du7/snake.c b/du7/snake.c index af977ad..6f8de67 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -33,7 +33,11 @@ struct snake* remove_snake(struct snake* snake){ } free(snake->next->next); snake->next = NULL; - return medzipamat; + snake = medzipamat; + + free(medzipamat); + + return snake; } }