diff --git a/cv5/a_train.c b/cv5/a_train.c index 2ee7397..1fc089a 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -87,6 +87,7 @@ struct car* clear_train(struct car* first, const char* target) { struct car* prev = NULL; if(first == this){ first = this->next; + this->next = NULL; free(this); return first; }