From 351ea0350e69aab3722503000b87c08730951e1a Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Fri, 26 Apr 2024 11:53:32 +0200 Subject: [PATCH] hadik --- cv9/snake.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cv9/snake.c b/cv9/snake.c index b5a963d..5549d4d 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -32,6 +32,11 @@ struct snake* remove_snake(struct snake* snake){ } void free_snake(struct snake* sn){ + if (sn == NULL) { + return; + } + free_snake(sn->next); + free(sn); } int is_snake(struct snake* snake,int x,int y){