struct dirstat_dir *dir,
unsigned long changed)
{
- /* This can happen even with many files, if everything was renames */
- if (!changed)
- return;
+ struct dirstat_file *to_free = dir->files;
+
+ if (!changed) {
+ /* This can happen even with many files, if everything was renames */
+ ;
+ } else {
+ /* Show all directories with more than x% of the changes */
+ QSORT(dir->files, dir->nr, dirstat_compare);
+ gather_dirstat(options, dir, changed, "", 0);
+ }
- /* Show all directories with more than x% of the changes */
- QSORT(dir->files, dir->nr, dirstat_compare);
- gather_dirstat(options, dir, changed, "", 0);
+ free(to_free);
}
static void show_dirstat(struct diff_options *options)