From 61443227a515d68956e5dd4adc52e8ef79911fec Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Mon, 2 Nov 2020 14:48:59 +0100 Subject: [PATCH] add --- cv5/a_train.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);