This commit is contained in:
Maryna Kravtsova 2020-11-02 14:19:09 +01:00
parent 9b936bc616
commit 3898228630

View File

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