fixed some shitty bugs in remove_node
yay now like 4561456456 bugs remain
This commit is contained in:
parent
85731bab38
commit
115a4c20de
@ -68,10 +68,14 @@ void remove_node(node_t *node) //valgrind says this causes memory leaks ('still
|
||||
node -> next -> last = node -> last;
|
||||
} else
|
||||
{
|
||||
node -> last = NULL;
|
||||
node -> last -> next = NULL; //idk there could be some bugz
|
||||
}
|
||||
|
||||
if (head == NULL) free(head); //LIST IS EMPTY NOW => DEALLOCATE
|
||||
if (head -> next == NULL) //LIST IS EMPTY NOW => DEALLOCATE
|
||||
{
|
||||
free(head);
|
||||
head = NULL;
|
||||
}
|
||||
|
||||
//DEALLOCATION
|
||||
free(node);
|
||||
|
Loading…
x
Reference in New Issue
Block a user