diff --git a/cv5/a_train.c b/cv5/a_train.c index f862e4c..c790802 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -68,6 +68,8 @@ struct car* clear_train(struct car* first, const char* target) { struct car* only = prev->next; free(prev); prev = only; + free(only); + only = NULL; return first; }