Check for failed allocations. Spotted by Martin Bealby.
Modified: trunk/reactos/lib/user32/windows/prop.c

Modified: trunk/reactos/lib/user32/windows/prop.c
--- trunk/reactos/lib/user32/windows/prop.c	2005-12-12 20:15:23 UTC (rev 20110)
+++ trunk/reactos/lib/user32/windows/prop.c	2005-12-12 20:24:20 UTC (rev 20111)
@@ -70,6 +70,11 @@
   if(Count > 0)
   {
     pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
+    if (pli == NULL)
+    {
+      SetLastError(ERROR_OUTOFMEMORY);
+      return -1;
+    }
 
     Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
     if(!NT_SUCCESS(Status))
@@ -132,6 +137,11 @@
   if(Count > 0)
   {
     pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
+    if (pli == NULL)
+    {
+      SetLastError(ERROR_OUTOFMEMORY);
+      return -1;
+    }
 
     Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
     if(!NT_SUCCESS(Status))
@@ -194,6 +204,11 @@
   if(Count > 0)
   {
     pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
+    if (pli == NULL)
+    {
+      SetLastError(ERROR_OUTOFMEMORY);
+      return -1;
+    }
 
     Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
     if(!NT_SUCCESS(Status))
@@ -256,6 +271,11 @@
   if(Count > 0)
   {
     pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
+    if (pli == NULL)
+    {
+      SetLastError(ERROR_OUTOFMEMORY);
+      return -1;
+    }
 
     Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
     if(!NT_SUCCESS(Status))