diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 8831320bcee0..5438bdad5cbf 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -596,6 +596,7 @@ public function calculateFolderSize($path, $entry = null) { 'WHERE `parent` = ? AND `storage` = ?'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { + $result->closeCursor(); list($sum, $min, $unencryptedSum) = array_values($row); $sum = 0 + $sum; $min = 0 + $min; @@ -618,6 +619,8 @@ public function calculateFolderSize($path, $entry = null) { if ($totalSize !== -1 and $unencryptedSum > 0) { $totalSize = $unencryptedSum; } + } else { + $result->closeCursor(); } } return $totalSize; diff --git a/lib/private/files/cache/homecache.php b/lib/private/files/cache/homecache.php index 2b3967c8807d..ad7f587b8b6d 100644 --- a/lib/private/files/cache/homecache.php +++ b/lib/private/files/cache/homecache.php @@ -35,6 +35,7 @@ public function calculateFolderSize($path, $entry = null) { 'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { + $result->closeCursor(); list($sum, $unencryptedSum) = array_values($row); $totalSize = 0 + $sum; $unencryptedSize = 0 + $unencryptedSum;