This commit is contained in:
Maryna Kravtsova 2020-11-04 11:13:41 +01:00
parent 8479e19522
commit d4212aaf74

View File

@ -68,6 +68,8 @@ struct car* clear_train(struct car* first, const char* target) {
struct car* only = prev->next; struct car* only = prev->next;
free(prev); free(prev);
prev = only; prev = only;
free(only);
only = NULL;
return first; return first;
} }