Plugging the memory leak
This commit is contained in:
parent
83a5f4b60c
commit
524c7c235c
@ -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){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user