dwrite: Initialize realloc'ed memory to zero.
This commit is contained in:
parent
0dad47ea36
commit
bfaacf80da
|
@ -34,6 +34,11 @@ static inline void *heap_realloc(void *mem, size_t len)
|
|||
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
||||
}
|
||||
|
||||
static inline void *heap_realloc_zero(void *mem, size_t len)
|
||||
{
|
||||
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
|
||||
}
|
||||
|
||||
static inline BOOL heap_free(void *mem)
|
||||
{
|
||||
return HeapFree(GetProcessHeap(), 0, mem);
|
||||
|
|
|
@ -468,7 +468,7 @@ static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory
|
|||
int new_count = 0;
|
||||
|
||||
new_count = This->loader_count * 2;
|
||||
new_list = heap_realloc(This->loaders, new_count * sizeof(*This->loaders));
|
||||
new_list = heap_realloc_zero(This->loaders, new_count * sizeof(*This->loaders));
|
||||
|
||||
if (!new_list)
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -603,7 +603,7 @@ static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory *iface
|
|||
int new_count = 0;
|
||||
|
||||
new_count = This->file_loader_count * 2;
|
||||
new_list = heap_realloc(This->file_loaders, new_count * sizeof(*This->file_loaders));
|
||||
new_list = heap_realloc_zero(This->file_loaders, new_count * sizeof(*This->file_loaders));
|
||||
|
||||
if (!new_list)
|
||||
return E_OUTOFMEMORY;
|
||||
|
|
Loading…
Reference in New Issue