Skip to content

Commit be3f4ed

Browse files
committed
explicitly close source stream on encryption storage
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent e60a829 commit be3f4ed

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,10 @@ protected function getHeader($path) {
926926
}
927927

928928
$result = [];
929-
929+
930930
// first check if it is an encrypted file at all
931931
// We would do query to filecache only if we know that entry in filecache exists
932-
932+
933933
$info = $this->getCache()->get($path);
934934
if (isset($info['encrypted']) && $info['encrypted'] === true) {
935935
$firstBlock = $this->readFirstBlock($path);
@@ -1033,6 +1033,7 @@ public function writeStream(string $path, $stream, int $size = null): int {
10331033
// always fall back to fopen
10341034
$target = $this->fopen($path, 'w');
10351035
[$count, $result] = \OC_Helper::streamCopy($stream, $target);
1036+
fclose($stream);
10361037
fclose($target);
10371038
return $count;
10381039
}

0 commit comments

Comments
 (0)