diff --git a/cv5/a_train.c b/cv5/a_train.c index dc9d48a..5fb8b74 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -82,9 +82,10 @@ struct car* clear_train(struct car* first, const char* target) { struct car* this = first; while(this != NULL){ while(this != NULL){ - int x =strcmp(this->value, target); + int x = strcmp(this->value, target); if(x == 0){ - return NULL; + free(this); + return first; } this = this->next; }