commit-slab: sizeof() the right type in xrealloc
commitcde0a0576c8950599ef11184bc35aea648f7e717
authorThomas Rast <tr@thomasrast.ch>
Sun, 1 Dec 2013 20:41:55 +0000 (1 21:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Dec 2013 20:46:01 +0000 (2 12:46 -0800)
tree53c952281c26148e9ff58d738d7ed01e293567a6
parente9e03a77994f4bf030760e2644f718776de0eb39
commit-slab: sizeof() the right type in xrealloc

When allocating the slab, the code accidentally computed the array
size from s->slab (an elemtype**).  The slab is an array of elemtype*,
however, so we should take the size of *s->slab.

Noticed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Thomas Rast <tr@thomasrast.ch>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-slab.h