]> source.dussan.org Git - nextcloud-server.git/commitdiff
Close open file handles in files library
authorMorris Jobke <hey@morrisjobke.de>
Wed, 13 Aug 2014 13:45:33 +0000 (15:45 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 13 Aug 2014 13:48:32 +0000 (15:48 +0200)
ref #10392

lib/private/files/storage/common.php
lib/private/files/storage/dav.php
lib/private/files/view.php

index 9657b511f153d518336f575898555038d19cdc6b..0720b8180c968214cdc500ef436810649f3b0ce1 100644 (file)
@@ -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;
        }
 
index 02c3ebd0202e5b67eb065fd9c648dbfab917550d..ce447417d20880fb67ec8c2f4a50f29a6c2fb068 100644 (file)
@@ -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);
        }
 
index 2a28e6fce881a794c9b4650c3ed632a46845471f..e036bacb751c4299ca84b1c5bac4e017c8e84e41 100644 (file)
@@ -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 {