Plugging the memory leak

This commit is contained in:
Anton Dolozin 2025-10-28 20:56:48 +01:00
parent 83a5f4b60c
commit 524c7c235c

View File

@ -61,8 +61,8 @@ struct car* clear_train(struct car* first, const char* target) {
return first; return first;
} }
struct car* prev= NULL; struct car* prev= first;
struct car* temp = first; struct car* temp = first->next;
while (temp) while (temp)
{ {
if(strcmp(temp->value, target) == 0){ if(strcmp(temp->value, target) == 0){