Skip to content

Commit 37317ab

Browse files
committed
Merge branch 'ad/preload-plug-memleak' into maint
The preload-index codepath made copies of pathspec to give to multiple threads, which were left leaked. * ad/preload-plug-memleak: preload-index: fix memleak
2 parents c61614e + 2357890 commit 37317ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

preload-index.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ void preload_index(struct index_state *index,
151151
}
152152
stop_progress(&pd.progress);
153153

154+
if (pathspec) {
155+
/* earlier we made deep copies for each thread to work with */
156+
for (i = 0; i < threads; i++)
157+
clear_pathspec(&data[i].pathspec);
158+
}
159+
154160
trace_performance_leave("preload index");
155161

156162
trace2_data_intmax("index", NULL, "preload/sum_lstat", t2_sum_lstat);

0 commit comments

Comments
 (0)