mirror of
https://github.com/nextcloud/server.git
synced 2026-05-12 16:39:39 -04:00
Close the streams in writeStream even when there is an exception
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
ad4c7bb30c
commit
f72a44525a
1 changed files with 6 additions and 3 deletions
|
|
@ -853,9 +853,12 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
|
|||
if (!$target) {
|
||||
return 0;
|
||||
}
|
||||
list($count, $result) = \OC_Helper::streamCopy($stream, $target);
|
||||
fclose($stream);
|
||||
fclose($target);
|
||||
try {
|
||||
[$count, $result] = \OC_Helper::streamCopy($stream, $target);
|
||||
} finally {
|
||||
fclose($target);
|
||||
fclose($stream);
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue