]> git.ipfire.org Git - thirdparty/git.git/blobdiff - unpack-trees.c
t1405: check for_each_reflog_ent_reverse() more thoroughly
[thirdparty/git.git] / unpack-trees.c
index a7e1712d2368a42ffb65e64778a322c2e5c18842..89ca95ce90b369bc521fc52fc9b071c467a74022 100644 (file)
@@ -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;
 }