From: Julius Härtl Date: Mon, 30 May 2022 15:53:07 +0000 (+0200) Subject: Cleanup temporary files after finishing the write to object storage X-Git-Tag: v24.0.2rc1~26^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=109bbf31db30985ea081a8e628da19afc8be7c8d;p=nextcloud-server.git Cleanup temporary files after finishing the write to object storage Signed-off-by: Julius Härtl --- diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index adb3928b28a..898f64d97c2 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -335,6 +335,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $handle = fopen($tmpFile, $mode); return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { $this->writeBack($tmpFile, $path); + unlink($tmpFile); }); case 'a': case 'ab': @@ -352,6 +353,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $handle = fopen($tmpFile, $mode); return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { $this->writeBack($tmpFile, $path); + unlink($tmpFile); }); } return false;