diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-08-29 14:55:15 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-08-29 14:55:15 -0700 |
| commit | f0deb3f2b561c6275b8fcc179c561e7e8da943e0 (patch) | |
| tree | b0e7bd553518395073644f52817b959009ee40de | |
| parent | Merge branch 'sg/xcalloc-cocci-fix' (diff) | |
| parent | preload-index: fix memleak (diff) | |
| download | git-f0deb3f2b561c6275b8fcc179c561e7e8da943e0.tar.gz git-f0deb3f2b561c6275b8fcc179c561e7e8da943e0.zip | |
Merge branch 'ad/preload-plug-memleak'
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/preload-index.c b/preload-index.c index e5529a5863..100f7a374d 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); |
