Check for failed allocation in GetNamedPipeHandleStateA.
[reactos.git] / reactos / lib / kernel32 / file / npipe.c
index a9fcd27..decc1bc 100644 (file)
@@ -924,6 +924,11 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
       SetLastError(ERROR_NOT_ENOUGH_MEMORY);
       return FALSE;
     }
+    if (UserNameW.Buffer == NULL)
+    {
+      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+      return FALSE;
+    }
 
     UserNameA.Buffer = lpUserName;
     UserNameA.Length = 0;