Memory leak struggles

This commit is contained in:
Anton Dolozin 2025-10-28 20:33:06 +01:00
parent 8a759d0386
commit 2d799d2ae9

View File

@ -70,6 +70,7 @@ struct car* clear_train(struct car* first, const char* target) {
if(strcmp(temp->value, target) == 0){ if(strcmp(temp->value, target) == 0){
prev->next = temp->next; prev->next = temp->next;
free(temp);
temp = prev->next; temp = prev->next;
} }