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