]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache-tree.c
use CALLOC_ARRAY
[thirdparty/git.git] / cache-tree.c
index 2fb483d3c0838998677d53327100db7bc134e2f3..add1f077131768414301fedaa3fefa9fa9ddbb45 100644 (file)
@@ -564,7 +564,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
         * hence +2.
         */
        it->subtree_alloc = subtree_nr + 2;
-       it->down = xcalloc(it->subtree_alloc, sizeof(struct cache_tree_sub *));
+       CALLOC_ARRAY(it->down, it->subtree_alloc);
        for (i = 0; i < subtree_nr; i++) {
                /* read each subtree */
                struct cache_tree *sub;