Marcus Meissner : user32: EM_REPLACESEL - handle OOM error.

Alexandre Julliard julliard at winehq.org
Wed Jan 6 13:00:56 CST 2010


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Wed Jan  6 16:52:46 2010 +0100

user32: EM_REPLACESEL - handle OOM error.

---

 dlls/user32/edit.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 20a853e..5bdef8a 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -4525,8 +4525,8 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B
 		{
 		    LPSTR textA = (LPSTR)lParam;
 		    INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);
-		    if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR))))
-			MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
+		    if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break;
+                    MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW);
 		}
 
 		EDIT_EM_ReplaceSel(es, (BOOL)wParam, textW, TRUE, TRUE);




More information about the wine-cvs mailing list