]> Pileus Git - ~andy/git/blobdiff - builtin-pack-objects.c
Merge git://repo.or.cz/git-gui
[~andy/git] / builtin-pack-objects.c
index 1158e42cba81e2bdb8640cd6c5a3835453d17e7f..59c30d1caa37416041177ff4aaf01b67f4e8add4 100644 (file)
@@ -1369,12 +1369,10 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
                        int window, int depth, unsigned *processed)
 {
        uint32_t i, idx = 0, count = 0;
-       unsigned int array_size = window * sizeof(struct unpacked);
        struct unpacked *array;
        unsigned long mem_usage = 0;
 
-       array = xmalloc(array_size);
-       memset(array, 0, array_size);
+       array = xcalloc(window, sizeof(struct unpacked));
 
        for (;;) {
                struct object_entry *entry = *list++;