This commit is contained in:
Maryna Kravtsova 2020-11-02 14:48:59 +01:00
parent df034f6c6d
commit 61443227a5

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -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);