Hi, Don't allocate the length of a pointer but rather the entire size of the struct hash_head data structure when creating the h_table array.
.joris Index: hash.c =================================================================== RCS file: /cvs/src/usr.bin/cvs/hash.c,v retrieving revision 1.2 diff -u -p -r1.2 hash.c --- hash.c 16 Jan 2015 06:40:07 -0000 1.2 +++ hash.c 22 Jun 2016 09:52:04 -0000 @@ -44,7 +44,7 @@ hash_table_init(struct hash_table *htabl hsize = 1 << power; } - htable->h_table = xcalloc(hsize, sizeof(struct hash_head *)); + htable->h_table = xcalloc(hsize, sizeof(struct hash_head)); htable->h_size = hsize; for (i = 0; i < htable->h_size; i++)