Skip to content

Commit

Permalink
Merge pull request #26832 from nextcloud/object-close-stream-non-count
Browse files Browse the repository at this point in the history
explicitly close source stream on object store upload even if count…
  • Loading branch information
juliusknorr authored May 21, 2021
2 parents b2c2f32 + ef6f2e6 commit b900d64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ public function writeStream(string $path, $stream, int $size = null): int {
$stat['size'] = $size;
} else {
$this->objectStore->writeObject($urn, $stream, $mimetype);
if (is_resource($stream)) {
fclose($stream);
}
}
} catch (\Exception $ex) {
if (!$exists) {
Expand Down

0 comments on commit b900d64

Please sign in to comment.