setupapi: Allocate the proper number of bytes for the drive spec.
authorAndrew Nguyen <anguyen@codeweavers.com>
Sat, 15 Jan 2011 08:28:30 +0000 (02:28 -0600)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 17 Jan 2011 14:58:29 +0000 (15:58 +0100)
Spotted with Valgrind.

dlls/setupapi/diskspace.c

index 89cac077cdd3e214a8a659c4f8fc60273b4e4a1b..0a1a5ff7a753ec07b2cca71c3af0251dee1b4731 100644 (file)
@@ -177,7 +177,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveW(HDSKSPC DiskSpace,
         return FALSE;
     }
 
-    driveW = HeapAlloc(GetProcessHeap(), 0, lstrlenW(DriveSpec) + 2);
+    driveW = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(DriveSpec) + 2) * sizeof(WCHAR));
     if (!driveW)
     {
         SetLastError(ERROR_NOT_ENOUGH_MEMORY);