From dd9a08fa82aac90bbfed92c67a0d5a4d70dee7c8 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 20 Sep 2021 18:27:12 +0200 Subject: [PATCH] explicitly close source stream on object store upload even if countwrapper isn't needed Signed-off-by: Daniel Kesselberg --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 89628a7763e..a6654a7e9a4 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -494,6 +494,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $stat['size'] = $size; } else { $this->objectStore->writeObject($urn, $stream); + if (is_resource($stream)) { + fclose($stream); + } } } catch (\Exception $ex) { if (!$exists) {