From 69bf18567f666d9568d68c5379a08451311e161c Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 6 Jan 2010 16:52:46 +0100 Subject: [PATCH] user32: EM_REPLACESEL - handle OOM error. --- dlls/user32/edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 20a853eacb1..5bdef8ac734 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); -- 2.11.4.GIT