summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiramisu Mokka <tigran.mkrtchyan@desy.de>2022-03-07 10:19:58 +0100
committerGitHub <noreply@github.com>2022-03-07 10:19:58 +0100
commit8190441335aaa01baed01a3984c0a153126a5d0f (patch)
treec1e31d6bac44df58e892fcc5ea86070c92f05c30
parentea75ad6a3d587ba5215871ce6db2d951b8487aee (diff)
downloadnextcloud-server-8190441335aaa01baed01a3984c0a153126a5d0f.tar.gz
nextcloud-server-8190441335aaa01baed01a3984c0a153126a5d0f.zip
files: close open directory file descriptor on error path
-rw-r--r--lib/private/Files/Storage/Common.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 7239c58a8a1..cfb2d621e1e 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -225,6 +225,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;
}
}