added check if pointer was found in why2_free

This commit is contained in:
Václav Šmejkal 2023-02-01 15:26:17 +01:00
parent f8f53b4305
commit 85731bab38
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -127,6 +127,6 @@ void why2_free(void *pointer)
node_buffer = node_buffer -> next; node_buffer = node_buffer -> next;
} }
remove_node(node_buffer); //REMOVE FROM LIST | IF ISN'T FOUND, PROBABLY WILL CAUSE SEGFAULT (I WON'T MAKE IT SAFE; FUCK YOU - USE why2_free ONLY IF YOU ALLOCATED WITH why2_foo) if (pointer == node_buffer -> pointer) remove_node(node_buffer); //REMOVE FROM LIST IF FOUND
free(pointer); free(pointer);
} }