Skip to content

Commit 678a9ca

Browse files
committed
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
2 parents 0b4fae5 + ddb3c85 commit 678a9ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

shallow.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
156156
for (i = 0; i < depths.slab_count; i++) {
157157
int j;
158158

159+
if (!depths.slab[i])
160+
continue;
159161
for (j = 0; j < depths.slab_size; j++)
160162
free(depths.slab[i][j]);
161163
}

0 commit comments

Comments
 (0)