Merge pull request #31475 from nextcloud/kofemann-patch-1

files: close open directory file descriptor on error path
This commit is contained in:
blizzz 2022-06-21 18:44:05 +02:00 committed by GitHub
commit 2e10378052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,6 +228,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
while ($file = readdir($dir)) {
if (!Filesystem::isIgnoredDir($file)) {
if (!$this->copy($path1 . '/' . $file, $path2 . '/' . $file)) {
closedir($dir);
return false;
}
}