From 966e7ab24375d2ed95b90ca41ec542a5dd82f9e8 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Mon, 2 Nov 2020 14:35:32 +0100 Subject: [PATCH] add --- cv5/a_train.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 5941132..a19da5c 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -45,8 +45,9 @@ void cancel_train(struct car* first) { if(first->next != NULL){ first->next = NULL; cancel_train(first->next); + free(first); } - else if(first->next == NULL){ + if(first->next == NULL){ free(first); }