summaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-09 05:00:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-09 05:00:59 (GMT)
commit678a9ca629403b533da19da6772691cd68b1040d (patch)
treeef984e4f6d8cb1bc0993ee7d9f1213ab1af74d0f /shallow.c
parent0b4fae553cdd5aa6713137e42cc03d396ecc1264 (diff)
parentddb3c856f32fe291b52544e177d2246c09cadd2c (diff)
downloadgit-678a9ca629403b533da19da6772691cd68b1040d.zip
git-678a9ca629403b533da19da6772691cd68b1040d.tar.gz
git-678a9ca629403b533da19da6772691cd68b1040d.tar.bz2
Merge branch 'as/shallow-slab-use-fix'
Correct code that tried to reference all entries in a sparse array of pointers by mistake. * as/shallow-slab-use-fix: shallow.c: don't free unallocated slabs
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shallow.c b/shallow.c
index 5fa2b15..c33ab94 100644
--- a/shallow.c
+++ b/shallow.c
@@ -156,6 +156,8 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
for (i = 0; i < depths.slab_count; i++) {
int j;
+ if (!depths.slab[i])
+ continue;
for (j = 0; j < depths.slab_size; j++)
free(depths.slab[i][j]);
}