d3dcompiler: Fix initial allocation (Valgrind).
authorMatteo Bruni <mbruni@codeweavers.com>
Mon, 7 Feb 2011 13:35:37 +0000 (14:35 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 21 Feb 2011 11:44:19 +0000 (12:44 +0100)
dlls/d3dcompiler_43/compiler.c

index 42ad09b27de8d6d40a34815bf7e5e4cc1acc3659..8527870956c0947f1439443912b8d1a7977d4074 100644 (file)
@@ -206,13 +206,13 @@ static void *wpp_open_mem(const char *filename, int type)
     {
         if(includes_capacity == 0)
         {
-            includes = HeapAlloc(GetProcessHeap(), 0, INCLUDES_INITIAL_CAPACITY);
+            includes = HeapAlloc(GetProcessHeap(), 0, INCLUDES_INITIAL_CAPACITY * sizeof(*includes));
             if(includes == NULL)
             {
                 ERR("Error allocating memory for the loaded includes structure\n");
                 goto error;
             }
-            includes_capacity = INCLUDES_INITIAL_CAPACITY;
+            includes_capacity = INCLUDES_INITIAL_CAPACITY * sizeof(*includes);
         }
         else
         {