This commit is contained in:
Maryna Kravtsova 2020-10-26 17:49:41 +01:00
parent 292d576b55
commit 798696cff7

View File

@ -37,6 +37,10 @@ void cancel_train(struct car* first) {
if(first == NULL){
exit(0);
}
else if(first->next == NULL){
free(first->next);
exit(0);
}
cancel_train(first->next);
free(first);
}