diff --git a/cv4/a_train.c b/cv4/a_train.c index c6296f4..f5fa973 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -65,8 +65,9 @@ struct car* clear_train(struct car* first, const char* target) { } while( this->next->next != NULL){ if(strcmp(this->next->value, target) == 0){ + struct car* third = this->next->next; free(this->next); - this->next = this->next->next; + this->next = third; return this; } else {