This commit is contained in:
Maryna Kravtsova 2020-10-27 17:42:13 +01:00
parent 96151e5e3b
commit 9ff85b4bc3

View File

@ -31,15 +31,15 @@ void print_train(struct car* first) {
} }
} }
void cancel_train(struct car* first) { void cancel_train(struct car* first) {
struct car *this = first->next;
if(first == NULL){ if(first == NULL){
exit(0); exit(0);
} }
if(first->value == NULL){ if(first->value == NULL){
//struct car *this = first->next;
free(first); free(first);
} }
cancel_train(this->next); cancel_train(first->next);
free(first); free(first);
} }