diff --git a/cv5/a_train.c b/cv5/a_train.c index cc680a7..e1f1dbc 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -38,8 +38,9 @@ void cancel_train(struct car* first) { exit(0); } if(first->next == NULL){ - free(first); - first = NULL; + struct car *this = first; + first = fitst->next; + free(this); exit(0); } cancel_train(first->next);