aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4160e6882..72289696d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3507,12 +3507,12 @@ static int for_each_file_in_obj_subdir(int subdir_nr,
break;
}
}
- strbuf_setlen(path, baselen);
+ closedir(dir);
+ strbuf_setlen(path, baselen);
if (!r && subdir_cb)
r = subdir_cb(subdir_nr, path->buf, data);
- closedir(dir);
return r;
}