diff options
Diffstat (limited to 'lib/private/Files/Storage/Common.php')
-rw-r--r-- | lib/private/Files/Storage/Common.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index edad9cc874c..bb672f3a0ea 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -859,9 +859,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; } } |