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:
parent
3804b99e72
commit
e4f15a297f
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue