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; } }