user32: EM_REPLACESEL - handle OOM error.
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 @@
{
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);