aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-04-23 11:47:39 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-04-23 14:35:02 +0200
commit323f95693cbe1721aec5c503cfb717c51575f141 (patch)
treea9fd22275276243b756abbba18c389830a8882c0 /apps/dav/lib/CalDAV
parent72a4f21efe02915e569693c080dcb04a1eeaf012 (diff)
downloadnextcloud-server-323f95693cbe1721aec5c503cfb717c51575f141.tar.gz
nextcloud-server-323f95693cbe1721aec5c503cfb717c51575f141.zip
Close open cursors
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index ba3daf8858c..15dabdbb14e 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -1894,8 +1894,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->andWhere($query->expr()->eq('co.uid', $query->createNamedParameter($uid)));
$stmt = $query->executeQuery();
-
- if ($row = $stmt->fetch()) {
+ $row = $stmt->fetch();
+ $stmt->closeCursor();
+ if ($row) {
return $row['calendaruri'] . '/' . $row['objecturi'];
}
@@ -2000,7 +2001,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// Fetching all changes
$stmt = $qb->executeQuery();
-
$changes = [];
// This loop ensures that any duplicates are overwritten, only the
@@ -2008,6 +2008,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
while ($row = $stmt->fetch()) {
$changes[$row['uri']] = $row['operation'];
}
+ $stmt->closeCursor();
foreach ($changes as $uri => $operation) {
switch ($operation) {
@@ -2035,6 +2036,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
);
$stmt = $qb->executeQuery();
$result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
+ $stmt->closeCursor();
}
return $result;
}