From: Matthias Kruk Date: Tue, 17 Sep 2019 07:18:34 +0000 (+0900) Subject: Make kmalloc() wipe the newly allocated memory X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=a85e1a29e35a5b957c4d8bad603b1864709f8f92;p=corax Make kmalloc() wipe the newly allocated memory --- diff --git a/kernel/arch/heap.c b/kernel/arch/heap.c index 6ce6d17..fa83b36 100644 --- a/kernel/arch/heap.c +++ b/kernel/arch/heap.c @@ -168,6 +168,9 @@ void* kmalloc(u32_t size) _kheap.h_free -= sizeof(*new); } + /* wipe the memory in case the caller forgets to */ + memset(ret_val, 0, size); + _kheap.h_free -= size; break;