[master] 6eaf812 Type error in sizeof.

Poul-Henning Kamp phk at FreeBSD.org
Mon May 5 10:24:08 CEST 2014


commit 6eaf812b4f573cdb2b07d751a1e219ac04fe4515
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 5 08:23:54 2014 +0000

    Type error in sizeof.
    
    Spotted by:	Coverity

diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 1656f0e..7a7693e 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -442,8 +442,8 @@ main(int argc, char **argv)
 
 	hist_range = hist_high - hist_low;
 	hist_buckets = hist_range * HIST_RES;
-	bucket_hit = calloc(sizeof bucket_hit, hist_buckets);
-	bucket_miss = calloc(sizeof bucket_miss, hist_buckets);
+	bucket_hit = calloc(sizeof *bucket_hit, hist_buckets);
+	bucket_miss = calloc(sizeof *bucket_miss, hist_buckets);
 
 	format = malloc(4 * fnum);
 	for (i = 0; i < fnum-1; i++) {



More information about the varnish-commit mailing list