Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-05-12 12:05:03 +0300
committerGitHub <noreply@github.com>2022-05-12 12:05:03 +0300
commit7d218bfb0a51147fafd673424f019444056d31b6 (patch)
tree3bdf7cff71a7e0322e11bb5485d6cdd215e36e6f
parentfc1db22629e33f3550daab0c737493ad21b3a8a7 (diff)
parent1cd05a06fafcca6d115ec4e4b210704439c1ab14 (diff)
Merge pull request #32344 from nextcloud/fix/always-free-db-result-qbmapper-find-entities
Always free the DB result in QBMapper::findEntities
-rw-r--r--lib/public/AppFramework/Db/QBMapper.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php
index fa753a09dcf..2491fd83f4a 100644
--- a/lib/public/AppFramework/Db/QBMapper.php
+++ b/lib/public/AppFramework/Db/QBMapper.php
@@ -334,16 +334,15 @@ abstract class QBMapper {
*/
protected function findEntities(IQueryBuilder $query): array {
$result = $query->executeQuery();
-
- $entities = [];
-
- while ($row = $result->fetch()) {
- $entities[] = $this->mapRowToEntity($row);
+ try {
+ $entities = [];
+ while ($row = $result->fetch()) {
+ $entities[] = $this->mapRowToEntity($row);
+ }
+ return $entities;
+ } finally {
+ $result->closeCursor();
}
-
- $result->closeCursor();
-
- return $entities;
}