]> git.scripts.mit.edu Git - git.git/blobdiff - preload-index.c
preload-index: fix memleak
[git.git] / preload-index.c
index e5529a586366d4031a5300d7ab0dfa6ec97489b8..100f7a374dca1b8ffaae1ae9a2c00011d05a208a 100644 (file)
@@ -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);