richedit: Missing HeapFree in WM_IME_COMPOSITION. (Smatch).

ME_InsertTextFromCursor copies the string passed into it rather than making
taking ownership of it.
This commit is contained in:
Dylan Smith 2010-05-24 01:04:42 -04:00 committed by Alexandre Julliard
parent 6d49edef37
commit fb7d6b783e
1 changed files with 2 additions and 0 deletions

View File

@ -4268,6 +4268,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, lpCompStr, dwBufLen);
lpCompStr[dwBufLen/sizeof(WCHAR)] = 0;
ME_InsertTextFromCursor(editor,0,lpCompStr,dwBufLen/sizeof(WCHAR),style);
HeapFree(GetProcessHeap(), 0, lpCompStr);
}
else if (lParam & GCS_COMPSTR)
{
@ -4280,6 +4281,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
lpCompStr[dwBufLen/sizeof(WCHAR)] = 0;
ME_InsertTextFromCursor(editor,0,lpCompStr,dwBufLen/sizeof(WCHAR),style);
HeapFree(GetProcessHeap(), 0, lpCompStr);
ME_SetSelection(editor,editor->imeStartIndex,
editor->imeStartIndex + dwBufLen/sizeof(WCHAR));
}