This commit is contained in:
Maryna Kravtsova 2020-11-02 14:33:30 +01:00
parent 6eef97b6ce
commit e6737ab602

View File

@ -43,8 +43,8 @@ void cancel_train(struct car* first) {
return; return;
} }
if(first->next != NULL){ if(first->next != NULL){
cancel_train(first->next);
first->next = NULL; first->next = NULL;
cancel_train(first->next);
} }
else if(first->next == NULL){ else if(first->next == NULL){
free(first); free(first);