Handle failed memory allocation
authorGregor Schneider <grschneider@gmail.com>
Sun, 23 Aug 2009 23:03:55 +0000 (23:03 +0000)
committerGregor Schneider <grschneider@gmail.com>
Sun, 23 Aug 2009 23:03:55 +0000 (23:03 +0000)
svn path=/trunk/; revision=42894

reactos/dll/win32/gdi32/objects/text.c

index c676368..2e2306b 100644 (file)
@@ -395,6 +395,10 @@ GetTextFaceA( HDC hdc, INT count, LPSTR name )
 
     res = GetTextFaceW(hdc, 0, NULL);
     nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 );
+    if (nameW == NULL)
+    {
+        return 0;
+    }
     GetTextFaceW( hdc, res, nameW );
 
     if (name)