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