From 5b3d26ec92bccbd6031be047b469b02a30bed302 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Tue, 27 Oct 2020 16:42:05 +0100 Subject: [PATCH] train2 --- cv5/a_train.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index cc680a7..e1f1dbc 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -38,8 +38,9 @@ void cancel_train(struct car* first) { exit(0); } if(first->next == NULL){ - free(first); - first = NULL; + struct car *this = first; + first = fitst->next; + free(this); exit(0); } cancel_train(first->next);