Commit c9dad2c6 authored by Sven Baars's avatar Sven Baars Committed by Michael Stefaniuc

mstask: Move memory allocation to avoid a memory leak (Valgrind).

Signed-off-by: 's avatarSven Baars <sven.wine@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org> (cherry picked from commit e4f15a29) Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org>
parent cf05d667
......@@ -143,10 +143,6 @@ static HRESULT WINAPI EnumWorkItems_Next(IEnumWorkItems *iface, ULONG count, LPW
enumerated = 0;
list = NULL;
allocated = 64;
list = CoTaskMemAlloc(allocated * sizeof(list[0]));
if (!list) return E_OUTOFMEMORY;
if (This->handle == INVALID_HANDLE_VALUE)
{
GetWindowsDirectoryW(path, MAX_PATH);
......@@ -161,6 +157,10 @@ static HRESULT WINAPI EnumWorkItems_Next(IEnumWorkItems *iface, ULONG count, LPW
return S_FALSE;
}
allocated = 64;
list = CoTaskMemAlloc(allocated * sizeof(list[0]));
if (!list) return E_OUTOFMEMORY;
do
{
if (is_file(&data))
......
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