From ae9d5ce5f70ca196ee6b71e9d16cd4ded914d4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 30 May 2017 12:21:54 +0200 Subject: [PATCH] user32: Fix memory leak in WinHelpA(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/user32/winhelp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/user32/winhelp.c b/dlls/user32/winhelp.c index a2c331b3159..c40b0fc8fcd 100644 --- a/dlls/user32/winhelp.c +++ b/dlls/user32/winhelp.c @@ -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; }