Check to make sure pointer isnt null after allocation. Fixes bug 1103.
authorBrandon Turner <turnerb7@msu.edu>
Sun, 11 Dec 2005 05:49:02 +0000 (05:49 +0000)
committerBrandon Turner <turnerb7@msu.edu>
Sun, 11 Dec 2005 05:49:02 +0000 (05:49 +0000)
svn path=/trunk/; revision=20051

reactos/lib/kernel32/misc/errormsg.c

index 1862cdc..a1fba62 100644 (file)
@@ -177,6 +177,10 @@ DWORD WINAPI FormatMessageA(
     if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
     {
         from = HeapAlloc( GetProcessHeap(), 0, strlen((LPCSTR)lpSource)+1 );
+        if (form == NULL)
+        {
+            return 0;
+        }
         strcpy( from, (LPCSTR)lpSource );
     }
     else {