Skip to content

Commit a626bec

Browse files
Cleanup temporary files after finishing the write to object storage
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent e15d678 commit a626bec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ public function fopen($path, $mode) {
335335
$handle = fopen($tmpFile, $mode);
336336
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
337337
$this->writeBack($tmpFile, $path);
338+
unlink($tmpFile);
338339
});
339340
case 'a':
340341
case 'ab':
@@ -352,6 +353,7 @@ public function fopen($path, $mode) {
352353
$handle = fopen($tmpFile, $mode);
353354
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
354355
$this->writeBack($tmpFile, $path);
356+
unlink($tmpFile);
355357
});
356358
}
357359
return false;

0 commit comments

Comments
 (0)