summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-08-14 10:57:54 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-14 10:57:54 +0200
commit987a0565fb04c273ce05bdde77d2084ceffa230e (patch)
tree342d8b33d7eddef1dba446c05993a1a60865e6e0 /lib
parent67b7160e7b250c4bf8a056a90ef5e2cb939b11eb (diff)
parentc6bf51c4574453b5bb492ebf21b70d7cbe3e029b (diff)
downloadnextcloud-server-987a0565fb04c273ce05bdde77d2084ceffa230e.tar.gz
nextcloud-server-987a0565fb04c273ce05bdde77d2084ceffa230e.zip
Merge pull request #10395 from owncloud/close-filehandle-lib-files
Close open file handles in files library
Diffstat (limited to 'lib')
-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 6749fcd55d2..1037056b0fb 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 {