InitTimerImpl did not check for NULL pointer when it alloc memory.
authorMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:53:35 +0000 (13:53 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:53:35 +0000 (13:53 +0000)
svn path=/trunk/; revision=20422

reactos/subsys/win32k/ntuser/timer.c

index 2e9d2a4..f3f5431 100644 (file)
@@ -181,8 +181,13 @@ InitTimerImpl(VOID)
 
    ExInitializeFastMutex(&Mutex);
 
-   BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
+   BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;   
    WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(PagedPool, BitmapBytes, TAG_TIMERBMP);
+   if (WindowLessTimersBitMapBuffer == NULL)
+   {
+      return STATUS_UNSUCCESSFUL;
+   }      
+   
    RtlInitializeBitMap(&WindowLessTimersBitMap,
                        WindowLessTimersBitMapBuffer,
                        BitmapBytes * 8);