fixing the memomory leak
This commit is contained in:
parent
50295427c8
commit
9f3eca6dd3
@ -70,7 +70,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
if(strcmp(temp->value, target) == 0){
|
||||
|
||||
prev->next = temp->next;
|
||||
free(temp);
|
||||
temp = NULL;
|
||||
temp = prev->next;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user