[ros-diffs] [gedmurphy] 25478: don't leak a bitmap object if we fail to allocate memory

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Tue Jan 16 01:08:41 CET 2007


Author: gedmurphy
Date: Tue Jan 16 03:08:41 2007
New Revision: 25478

URL: http://svn.reactos.org/svn/reactos?rev=25478&view=rev
Log:
don't leak a bitmap object if we fail to allocate memory

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c?rev=25478&r1=25477&r2=25478&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Tue Jan 16 03:08:41 2007
@@ -1516,8 +1516,8 @@
         {
             BITMAPINFO bi;
             BITMAP bm;
-            BITMAPOBJ *Bitmap;
-            PBYTE pBits;
+            BITMAPOBJ *Bitmap = NULL;
+            PBYTE pBits = NULL;
             BLENDFUNCTION  BlendFunc;
             BYTE Red, Green, Blue, Alpha;
             DWORD Count = 0;
@@ -1547,6 +1547,7 @@
             if (pBits == NULL)
             {
                 DPRINT1("ExAllocatePoolWithTag() failed!\n");
+                GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap);
                 goto cleanup;
             }
 
@@ -1609,7 +1610,6 @@
 cleanup:
    if(DoFlickerFree)
    {
-
       if(hOldOffBmp) NtGdiSelectObject(hdcOff, hOldOffBmp);
       if(hOldOffBrush) NtGdiSelectObject(hdcOff, hOldOffBrush);
       if(hbmOff) NtGdiDeleteObject(hbmOff);




More information about the Ros-diffs mailing list