]> git.corax.cc Git - corax/commitdiff
Make kmalloc() wipe the newly allocated memory
authorMatthias Kruk <m@m10k.eu>
Tue, 17 Sep 2019 07:18:34 +0000 (16:18 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 17 Sep 2019 07:18:34 +0000 (16:18 +0900)
kernel/arch/heap.c

index 6ce6d1783797f38243e54568ee6d2503e6db111f..fa83b368ed2cac096ad4561d932bfc89dd2e81d9 100644 (file)
@@ -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;