summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2023-07-11 07:58:16 +0200
committerRichard Steinmetz <richard@steinmetz.cloud>2023-07-11 08:02:45 +0200
commitf2e90444940d71f075214dcca8c0e69066dce7f4 (patch)
tree72897836daa3b2b7b1fc90cf627dcb8dd0c2bb60 /apps/dav
parent011c19ce5db5a3f95fe8a7b30d8164113e51e644 (diff)
downloadnextcloud-server-f2e90444940d71f075214dcca8c0e69066dce7f4.tar.gz
nextcloud-server-f2e90444940d71f075214dcca8c0e69066dce7f4.zip
fix(dav): close cursor when fetching max id
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php4
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php4
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 94fe9acf356..b872823d76d 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -3139,7 +3139,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$query->select($query->func()->max('id'))
->from('calendarchanges');
- $maxId = $query->executeQuery()->fetchOne();
+ $result = $query->executeQuery();
+ $maxId = (int) $result->fetchOne();
+ $result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
}
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 1be1ce3f18f..045ad4d1385 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1404,7 +1404,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query->select($query->func()->max('id'))
->from('addressbookchanges');
- $maxId = $query->executeQuery()->fetchOne();
+ $result = $query->executeQuery();
+ $maxId = (int) $result->fetchOne();
+ $result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
}