kfree: check if pointer NULL

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-11 23:56:26 -04:00
commit 7833400893

View file

@ -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)