kfree: check if pointer NULL
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
6c2613ab96
commit
7833400893
1 changed files with 3 additions and 0 deletions
|
|
@ -88,6 +88,9 @@ void *kzalloc(size_t size, u64 flags)
|
|||
|
||||
void kfree(void *ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
return;
|
||||
|
||||
rbnode_t *node = rbt_search(&kalloc_tree, (u64)ptr);
|
||||
|
||||
if (!node)
|
||||
|
|
|
|||
Loading…
Reference in a new issue