mirror of https://github.com/flysand7/ciabatta.git
fix calloc not returned zeroed-out memory
This commit is contained in:
parent
a04353a63c
commit
601c4cc6c9
|
@ -64,6 +64,7 @@ void *_mem_alloc(size_t alignment, size_t size) {
|
||||||
// memory buffer according to required alignment.
|
// memory buffer according to required alignment.
|
||||||
size_t block_size = _mem_min_block_size(alignment, size);
|
size_t block_size = _mem_min_block_size(alignment, size);
|
||||||
void *block_start = HeapAlloc(heap_handle, 0, block_size);
|
void *block_start = HeapAlloc(heap_handle, 0, block_size);
|
||||||
|
memset(block_start, 0, block_size);
|
||||||
if(block_start == NULL) {
|
if(block_start == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue