From 533abadd61efacd88e6fbcf8bdb44c7156d376cc Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 5 Nov 2020 16:51:56 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cv5/a_train.c b/cv5/a_train.c index 2889b4d..1ebbae1 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -59,6 +59,9 @@ struct car* clear_train(struct car* first, const char* target) { if(first->next == NULL){ free(first); return NULL; + } + else{ + return first; } prev = first->next; free(first);