Skip to content

Commit 2e10378

Browse files
authored
Merge pull request #31475 from nextcloud/kofemann-patch-1
files: close open directory file descriptor on error path
2 parents 632d4d9 + 8190441 commit 2e10378

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/private/Files/Storage/Common.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public function copy($path1, $path2) {
228228
while ($file = readdir($dir)) {
229229
if (!Filesystem::isIgnoredDir($file)) {
230230
if (!$this->copy($path1 . '/' . $file, $path2 . '/' . $file)) {
231+
closedir($dir);
231232
return false;
232233
}
233234
}

0 commit comments

Comments
 (0)