From ac53ed8b42dddb7870fa300f0eb7f15bf0a62247 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Fri, 5 Nov 2021 08:16:58 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'cv4/a=5Ftrain.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv4/a_train.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 5fdfd7e..3b66395 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -43,10 +43,9 @@ void cancel_train(struct car* first){ while(next != NULL){ next = temp->next; - + free(temp); temp = next; } - free(temp); first = NULL; } @@ -61,12 +60,11 @@ struct car* clear_train(struct car* first, const char* target){ while(temp != NULL){ next = temp->next; if(!strcmp(temp->value, target)) - + free(temp); temp = next; if(!first) first = temp; } - free(temp); return first; } \ No newline at end of file