user32: Fix memory leak in WinHelpA().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-05-30 12:21:54 +02:00 committed by Alexandre Julliard
parent 1cd883fcb5
commit ae9d5ce5f7
1 changed files with 4 additions and 1 deletions

View File

@ -80,6 +80,7 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand, ULONG_PTR dwD
HWND hDest;
int size, dsize, nlen;
WINHELP* lpwh;
LRESULT ret;
hDest = FindWindowA("MS_WINHELP", NULL);
if (!hDest)
@ -156,7 +157,9 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand, ULONG_PTR dwD
lpwh->size, lpwh->command, lpwh->data,
lpwh->ofsFilename ? (LPSTR)lpwh + lpwh->ofsFilename : "");
return SendMessageA(hDest, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&cds);
ret = SendMessageA(hDest, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&cds);
HeapFree(GetProcessHeap(), 0, lpwh);
return ret;
}