defined why2_clean_memory
it should be complete now, time to implement it
This commit is contained in:
parent
790eada639
commit
b49f582c5c
@ -138,3 +138,19 @@ void why2_free(void *pointer)
|
|||||||
|
|
||||||
free(pointer);
|
free(pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void why2_clean_memory(char *identifier)
|
||||||
|
{
|
||||||
|
if (head == NULL) return; //LIST IS EMPTY
|
||||||
|
|
||||||
|
node_t *buffer = head;
|
||||||
|
|
||||||
|
while (buffer -> next != NULL) //GO TROUGH LIST
|
||||||
|
{
|
||||||
|
if (buffer -> identifier == identifier) remove_node(buffer);
|
||||||
|
|
||||||
|
buffer = buffer -> next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buffer -> identifier == identifier) remove_node(buffer); //LAST NODE
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user