diff --git a/du4/a_train.c b/du4/a_train.c index 69ebd66..72f40e0 100644 --- a/du4/a_train.c +++ b/du4/a_train.c @@ -65,9 +65,8 @@ struct car* clear_train(struct car* first, const char* target) { struct car* next = first->next; while (next->next) {if(strcmp(next->value, target) == 0){ - - temp->next = next->next; next->next = NULL; + temp->next = next->next; free(next); }