aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Local.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Storage/Local.php')
-rw-r--r--lib/private/Files/Storage/Local.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index ccd331f515f..eea04bd8676 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -568,8 +568,11 @@ class Local extends \OC\Files\Storage\Common {
public function writeStream(string $path, $stream, int $size = null): int {
$result = $this->file_put_contents($path, $stream);
+ if (is_resource($stream)) {
+ fclose($stream);
+ }
if ($result === false) {
- throw new GenericFileException("Failed write steam to $path");
+ throw new GenericFileException("Failed write stream to $path");
} else {
return $result;
}