From 9ff85b4bc33c254d04b329f9b9670fd078e30d3d Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Tue, 27 Oct 2020 17:42:13 +0100 Subject: [PATCH] train2 --- cv5/a_train.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 5f0b59e..99d4d0b 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -31,15 +31,15 @@ void print_train(struct car* first) { } } -void cancel_train(struct car* first) { - struct car *this = first->next; +void cancel_train(struct car* first) { if(first == NULL){ exit(0); } if(first->value == NULL){ + //struct car *this = first->next; free(first); } - cancel_train(this->next); + cancel_train(first->next); free(first); }