summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-08-13 15:45:33 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-13 15:48:32 +0200
commitc6bf51c4574453b5bb492ebf21b70d7cbe3e029b (patch)
tree05caf0eb35289d6303fe4a44afab96add2468b4f
parent9ab0ebbedc2660b1ed4fd5b84927295a6a2cc2fd (diff)
downloadnextcloud-server-c6bf51c4574453b5bb492ebf21b70d7cbe3e029b.tar.gz
nextcloud-server-c6bf51c4574453b5bb492ebf21b70d7cbe3e029b.zip
Close open file handles in files library
ref #10392
-rw-r--r--lib/private/files/storage/common.php1
-rw-r--r--lib/private/files/storage/dav.php1
-rw-r--r--lib/private/files/view.php1
3 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 9657b511f15..0720b8180c9 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -226,6 +226,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
$tmpFile = \OC_Helper::tmpFile($extension);
$target = fopen($tmpFile, 'w');
\OC_Helper::streamCopy($source, $target);
+ fclose($target);
return $tmpFile;
}
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 02c3ebd0202..ce447417d20 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -295,6 +295,7 @@ class DAV extends \OC\Files\Storage\Common {
\OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR);
}
curl_close($curl);
+ fclose($source);
$this->removeCachedFile($target);
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 2a28e6fce88..e036bacb751 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -670,6 +670,7 @@ class View {
$source = fopen($tmpFile, 'r');
if ($source) {
$this->file_put_contents($path, $source);
+ fclose($source);
unlink($tmpFile);
return true;
} else {