diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 89628a7763e87..a6654a7e9a420 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -494,6 +494,9 @@ public function writeStream(string $path, $stream, int $size = null): int { $stat['size'] = $size; } else { $this->objectStore->writeObject($urn, $stream); + if (is_resource($stream)) { + fclose($stream); + } } } catch (\Exception $ex) { if (!$exists) {