Commit bfaacf80 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

dwrite: Initialize realloc'ed memory to zero.

parent 0dad47ea
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment