From dbd2844ed5ff37b05a7d4182e6c6e057c6400702 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Tue, 3 Nov 2020 18:10:14 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cv5/a_train.c b/cv5/a_train.c index baf72b4..23ec151 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -56,6 +56,7 @@ struct car* clear_train(struct car* first, const char* target) { int result = strcmp(first->value, target); if(result == 0){ free(first); + free(first->value); return 0; } } @@ -67,6 +68,7 @@ struct car* clear_train(struct car* first, const char* target) { struct car* temp = this->next; strcpy(this->value,temp->value); free(temp); + free(temp->value); return 0; } this = this->next;