Author: tkreuzer
Date: Fri Sep 17 01:34:50 2010
New Revision: 48785
URL: http://svn.reactos.org/svn/reactos?rev=48785&view=rev
Log:
[WIN32K]
Fix a bug, where a failure to allocate the kernel mode WINDOW_OBJECT would cause a page fault, because the WND was still allocated, but never initialized, and Wnd->rpdesktop was then dereferenced to free the WND again.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Sep 17 01:34:50 2010
@@ -1661,10 +1661,14 @@
(PHANDLE)&hWnd,
otWindow,
sizeof(WINDOW_OBJECT));
+ if (!Window)
+ {
+ goto AllocError;
+ }
Wnd = DesktopHeapAlloc(pti->rpdesk, sizeof(WND) + Class->cbwndExtra);
- if(!Window || !Wnd)
+ if (!Wnd)
{
goto AllocError;
}