moved NULL check to top of why2_deallocate
This commit is contained in:
parent
c5d5f12140
commit
6844b3d218
@ -165,6 +165,8 @@ void why2_deallocate(void *pointer)
|
|||||||
//VARIABLES
|
//VARIABLES
|
||||||
node_t *node = get_node(pointer);
|
node_t *node = get_node(pointer);
|
||||||
|
|
||||||
|
if (node == NULL) return;
|
||||||
|
|
||||||
switch (node -> type) //DEALLOCATE BY THE CORRECT WAY
|
switch (node -> type) //DEALLOCATE BY THE CORRECT WAY
|
||||||
{
|
{
|
||||||
case ALLOCATION: //STANDARD MALLOC, CALLOC OR REALLOC
|
case ALLOCATION: //STANDARD MALLOC, CALLOC OR REALLOC
|
||||||
@ -184,7 +186,7 @@ void why2_deallocate(void *pointer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node != NULL) remove_node(node); //REMOVE FROM LIST IF FOUND
|
remove_node(node); //REMOVE FROM LIST IF FOUND
|
||||||
}
|
}
|
||||||
|
|
||||||
void why2_clean_memory(char *identifier)
|
void why2_clean_memory(char *identifier)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user