diff --git a/cv5/a_train.c b/cv5/a_train.c index d9ccdbd..0ff8ff7 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -69,7 +69,7 @@ struct car* clear_train(struct car* first, const char* target) { if(first == this){ first = this->next; free(this); - return 0; + return first; } while(curr != this){ prev = curr; @@ -77,7 +77,7 @@ struct car* clear_train(struct car* first, const char* target) { } prev->next = curr->next; - //free(this); + free(this); } this = this->next; }