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