Merge pull request #10395 from owncloud/close-filehandle-lib-files
Close open file handles in files library
This commit is contained in:
commit
987a0565fb
|
@ -226,6 +226,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
||||||
$tmpFile = \OC_Helper::tmpFile($extension);
|
$tmpFile = \OC_Helper::tmpFile($extension);
|
||||||
$target = fopen($tmpFile, 'w');
|
$target = fopen($tmpFile, 'w');
|
||||||
\OC_Helper::streamCopy($source, $target);
|
\OC_Helper::streamCopy($source, $target);
|
||||||
|
fclose($target);
|
||||||
return $tmpFile;
|
return $tmpFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
\OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR);
|
||||||
}
|
}
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
|
fclose($source);
|
||||||
$this->removeCachedFile($target);
|
$this->removeCachedFile($target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -670,6 +670,7 @@ class View {
|
||||||
$source = fopen($tmpFile, 'r');
|
$source = fopen($tmpFile, 'r');
|
||||||
if ($source) {
|
if ($source) {
|
||||||
$this->file_put_contents($path, $source);
|
$this->file_put_contents($path, $source);
|
||||||
|
fclose($source);
|
||||||
unlink($tmpFile);
|
unlink($tmpFile);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue