This commit is contained in:
Maryna Kravtsova 2020-11-02 14:35:32 +01:00
parent e6737ab602
commit 966e7ab243

View File

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