Dylan Smith : richedit: Missing HeapFree in WM_IME_COMPOSITION. (Smatch).

Alexandre Julliard julliard at winehq.org
Mon May 24 11:30:49 CDT 2010


Module: wine
Branch: master
Commit: fb7d6b783e8f8c48943772da3fd909e968887137
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fb7d6b783e8f8c48943772da3fd909e968887137

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon May 24 01:04:42 2010 -0400

richedit: Missing HeapFree in WM_IME_COMPOSITION. (Smatch).

ME_InsertTextFromCursor copies the string passed into it rather than making
taking ownership of it.

---

 dlls/riched20/editor.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 85e8f14..7764614 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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));
     }




More information about the wine-cvs mailing list