Author: sginsberg
Date: Thu Jan 22 11:04:06 2009
New Revision: 39024
URL:
http://svn.reactos.org/svn/reactos?rev=39024&view=rev
Log:
- Fix a crash when menu allocation fails
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Thu Jan 22 11:04:06
2009
@@ -1566,15 +1566,14 @@
return (HMENU)0;
}
Menu = IntCreateMenu(&Handle, !PopupMenu);
- UserDereferenceObject(Menu);
ObDereferenceObject(WinStaObject);
}
else
{
Menu = IntCreateMenu(&Handle, !PopupMenu);
- UserDereferenceObject(Menu);
- }
-
+ }
+
+ if (Menu) UserDereferenceObject(Menu);
return (HMENU)Handle;
}