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

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2019-02-06 11:48:19 +01:00 committed by Alexandre Julliard
parent 3804b99e72
commit e4f15a297f
1 changed files with 4 additions and 4 deletions

View File

@ -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))