From 524c7c235c2469420ef383c43ffa4732137acc4c Mon Sep 17 00:00:00 2001 From: Anton Dolozin Date: Tue, 28 Oct 2025 20:56:48 +0100 Subject: [PATCH] Plugging the memory leak --- du4/a_train.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/du4/a_train.c b/du4/a_train.c index 1bbb98c..8825eec 100644 --- a/du4/a_train.c +++ b/du4/a_train.c @@ -61,8 +61,8 @@ struct car* clear_train(struct car* first, const char* target) { return first; } - struct car* prev= NULL; - struct car* temp = first; + struct car* prev= first; + struct car* temp = first->next; while (temp) { if(strcmp(temp->value, target) == 0){