From d8e2d7f3e1d1d0839be70a996dcafaa60eb0286f Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Tue, 3 Nov 2020 21:25:57 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 7d01f99..df864c0 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -84,7 +84,9 @@ struct car* clear_train(struct car* first, const char* target) { while(this != NULL){ int x = strcmp(this->value, target); if(x == 0){ - free(this->next); + this->next = NULL; + //free(this->next); + return first; } this = this->next;