summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-13 19:21:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-13 19:21:10 (GMT)
commit37317ab40b9fd2458ce48fe10e34bb9d478224a9 (patch)
treef331b6845748e0f96dba10652e5225c522020b43
parentc61614e30f6df550a5d48fc115fb6a92266ecf50 (diff)
parent23578904da8eef802752b48f9a2d4ea9f8a60c59 (diff)
downloadgit-37317ab40b9fd2458ce48fe10e34bb9d478224a9.zip
git-37317ab40b9fd2458ce48fe10e34bb9d478224a9.tar.gz
git-37317ab40b9fd2458ce48fe10e34bb9d478224a9.tar.bz2
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
-rw-r--r--preload-index.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/preload-index.c b/preload-index.c
index e5529a5..100f7a3 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -151,6 +151,12 @@ void preload_index(struct index_state *index,
}
stop_progress(&pd.progress);
+ if (pathspec) {
+ /* earlier we made deep copies for each thread to work with */
+ for (i = 0; i < threads; i++)
+ clear_pathspec(&data[i].pathspec);
+ }
+
trace_performance_leave("preload index");
trace2_data_intmax("index", NULL, "preload/sum_lstat", t2_sum_lstat);