Skip to content

Commit

Permalink
Merge pull request #28905 from nextcloud/backport/26832/stable21
Browse files Browse the repository at this point in the history
[stable21] explicitly close source stream on object store upload even if count…
  • Loading branch information
MichaIng authored Sep 24, 2021
2 parents 9f8d907 + dd9a08f commit ea39319
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 @@ -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) {
Expand Down

0 comments on commit ea39319

Please sign in to comment.