ec13a7
From 35ce23a327648a225f5c768a79890a761b9dbe27 Mon Sep 17 00:00:00 2001
ec13a7
From: Jonathan Wakely <boost@kayari.org>
ec13a7
Date: Wed, 10 Oct 2018 13:47:13 +0100
ec13a7
Subject: [PATCH] Use correct sizeof in malloc call
ec13a7
ec13a7
This is allocating space for `nel` objects of type `ITEM*` so it should use `sizeof(ITEM*)` not `sizeof(ITEM**)`.
ec13a7
ec13a7
In practice the values are the same, but using the correct type is better anyway, and now matches the same calculation in the `memset` call in the following statement.
ec13a7
---
ec13a7
 src/engine/hash.c | 2 +-
ec13a7
 1 file changed, 1 insertion(+), 1 deletion(-)
ec13a7
ec13a7
diff --git a/src/engine/hash.c b/src/engine/hash.c
ec13a7
index 2fa12030b8..f3dcef88a5 100644
ec13a7
--- a/tools/build/src/engine/hash.c
ec13a7
+++ b/tools/build/src/engine/hash.c
ec13a7
@@ -248,7 +248,7 @@ static void hashrehash( struct hash * hp )
ec13a7
         BJAM_FREE( (char *)hp->tab.base );
ec13a7
 
ec13a7
     hp->tab.nel = hp->items.nel * hp->bloat;
ec13a7
-    hp->tab.base = (ITEM * *)BJAM_MALLOC( hp->tab.nel * sizeof( ITEM * * ) );
ec13a7
+    hp->tab.base = (ITEM * *)BJAM_MALLOC( hp->tab.nel * sizeof( ITEM * ) );
ec13a7
 
ec13a7
     memset( (char *)hp->tab.base, '\0', hp->tab.nel * sizeof( ITEM * ) );
ec13a7