diff --git a/cv5/a_train.c b/cv5/a_train.c index a19da5c..d2ee26a 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -40,12 +40,12 @@ void print_train(struct car* first) { void cancel_train(struct car* first) { if(first == NULL){ - return; + exit(0); } if(first->next != NULL){ - first->next = NULL; cancel_train(first->next); - free(first); + first->next = NULL; + //free(first); } if(first->next == NULL){ free(first);