From d4212aaf741364136d1c51f7790e76d7b9d9b352 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Wed, 4 Nov 2020 11:13:41 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cv5/a_train.c b/cv5/a_train.c index f862e4c..c790802 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -68,6 +68,8 @@ struct car* clear_train(struct car* first, const char* target) { struct car* only = prev->next; free(prev); prev = only; + free(only); + only = NULL; return first; }