]> git.ipfire.org Git - thirdparty/git.git/blobdiff - commit-slab.h
commit-slab: sizeof() the right type in xrealloc
[thirdparty/git.git] / commit-slab.h
index d068e2d5316c93cd5120d56cfd146a34b9fe2913..cc114b53b096c6fc8574629b86659a639fdfed61 100644 (file)
@@ -91,7 +91,7 @@ static MAYBE_UNUSED elemtype *slabname## _at(struct slabname *s,      \
        if (s->slab_count <= nth_slab) {                                \
                int i;                                                  \
                s->slab = xrealloc(s->slab,                             \
-                                  (nth_slab + 1) * sizeof(s->slab));   \
+                                  (nth_slab + 1) * sizeof(*s->slab));  \
                stat_ ##slabname## realloc++;                           \
                for (i = s->slab_count; i <= nth_slab; i++)             \
                        s->slab[i] = NULL;                              \