diff --git a/cv5/a_train.c b/cv5/a_train.c index 84d9a65..69224f0 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -78,7 +78,7 @@ struct car* clear_train(struct car* first, const char* target) { prev = tmp; tmp = tmp->next; } - free(prev->next); + free(temp); prev->next = NULL; }