Skip to content

Commit

Permalink
explicitly close source stream on object store upload even if count w…
Browse files Browse the repository at this point in the history
…rapper isn't needed

Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Apr 29, 2021
1 parent 22ba8fa commit ef6f2e6
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 ef6f2e6

Please sign in to comment.