diff --git a/cv5/a_train.c b/cv5/a_train.c index 5941132..a19da5c 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -45,8 +45,9 @@ void cancel_train(struct car* first) { if(first->next != NULL){ first->next = NULL; cancel_train(first->next); + free(first); } - else if(first->next == NULL){ + if(first->next == NULL){ free(first); }