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;