Author: tkreuzer Date: Sun May 27 16:48:45 2007 New Revision: 26920
URL: http://svn.reactos.org/svn/reactos?rev=26920&view=rev Log: fix region leak
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Sun May 27 16:48:45 2007 @@ -166,15 +166,20 @@ Window->UpdateRegion != (HRGN)1) { hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0); - hRgnWindow = IntCalcWindowRgn(Window, TRUE);
/* * If region creation fails it's safe to fallback to whole * window region. */ - if (hRgnNonClient == NULL) { + return (HRGN)1; + } + + hRgnWindow = IntCalcWindowRgn(Window, TRUE); + if (hRgnWindow == NULL) + { + NtGdiDeleteObject(hRgnNonClient); return (HRGN)1; }
@@ -182,11 +187,13 @@ hRgnWindow, RGN_DIFF); if (RgnType == ERROR) { + NtGdiDeleteObject(hRgnWindow); NtGdiDeleteObject(hRgnNonClient); return (HRGN)1; } else if (RgnType == NULLREGION) { + NtGdiDeleteObject(hRgnWindow); NtGdiDeleteObject(hRgnNonClient); return NULL; }