Commit bb1f8edc authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

riched20: Fix a memory leak.

parent 0f6c58c1
......@@ -2201,20 +2201,26 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
FINDTEXTA *ft = (FINDTEXTA *)lParam;
int nChars = MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, NULL, 0);
WCHAR *tmp;
LRESULT r;
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, tmp, nChars);
return ME_FindText(editor, wParam, &ft->chrg, tmp, NULL);
r = ME_FindText(editor, wParam, &ft->chrg, tmp, NULL);
FREE_OBJ( tmp );
return r;
}
case EM_FINDTEXTEX:
{
FINDTEXTEXA *ex = (FINDTEXTEXA *)lParam;
int nChars = MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, NULL, 0);
WCHAR *tmp;
LRESULT r;
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, tmp, nChars);
return ME_FindText(editor, wParam, &ex->chrg, tmp, &ex->chrgText);
r = ME_FindText(editor, wParam, &ex->chrg, tmp, &ex->chrgText);
FREE_OBJ( tmp );
return r;
}
case EM_FINDTEXTW:
{
......
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