Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: > diff --git a/unpack-trees.c b/unpack-trees.c > index a7e1712d236..89ca95ce90b 100644 > --- a/unpack-trees.c > +++ b/unpack-trees.c > @@ -2156,9 +2156,10 @@ static int verify_clean_subdirectory(const struct cache_entry *ce, > if (o->dir) > d.exclude_per_dir = o->dir->exclude_per_dir; > i = read_directory(&d, o->src_index, pathbuf, namelen+1, NULL); > + dir_clear(&d); > + free(pathbuf); > if (i) > return add_rejected_path(o, ERROR_NOT_UPTODATE_DIR, ce->name); > - free(pathbuf); > return cnt; > } Looks trivially correct.