diff --git a/cv5/a_train.c b/cv5/a_train.c index 3c6f15a..a2d0d02 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -1,4 +1,5 @@ #include + #include #include @@ -43,9 +44,10 @@ void cancel_train(struct car* first) { return; } else if(first->next != NULL){ - cancel_train(first->next); - first->next = NULL; + struct car* help = first->next; free(first); + cancel_train(help); + //first->next = NULL; } else if(first->next == NULL){ free(first);