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); }