summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2015-10-27 10:22:59 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-08 20:27:01 +0100
commit17a066c18e6d855895bb4604988d5ed40a423dc8 (patch)
tree781dc106fb313dff70785a6a6559e814af7f5e38 /lib
parent629bac22fd724ac8bcde6401782d9d2517556137 (diff)
downloadnextcloud-server-17a066c18e6d855895bb4604988d5ed40a423dc8.tar.gz
nextcloud-server-17a066c18e6d855895bb4604988d5ed40a423dc8.zip
Properly close db cursors
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/share.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index f02b2e9c770..63639461f0a 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -1123,9 +1123,10 @@ class Share extends Constants {
->from('share')
->where($qb->expr()->eq('id', $qb->createParameter('id')))
->setParameter(':id', $rootItem['parent']);
- $result = $qb->execute();
+ $dbresult = $qb->execute();
- $result = $result->fetch();
+ $result = $dbresult->fetch();
+ $dbresult->closeCursor();
if (~(int)$result['permissions'] & $permissions) {
$message = 'Setting permissions for %s failed,'
.' because the permissions exceed permissions granted to %s';
@@ -1189,6 +1190,7 @@ class Share extends Constants {
$parents[] = $item['id'];
}
}
+ $result->closeCursor();
}
// Remove the permissions for all reshares of this item
@@ -1209,7 +1211,7 @@ class Share extends Constants {
/*
* Permissions were added
- * Update all USERGROUP shares. (So group shares where the user moved his mountpoint).
+ * Update all USERGROUP shares. (So group shares where the user moved their mountpoint).
*/
if ($permissions & ~(int)$rootItem['permissions']) {
$qb = $connection->getQueryBuilder();
@@ -1229,6 +1231,7 @@ class Share extends Constants {
$items[] = $item;
$ids[] = $item['id'];
}
+ $result->closeCursor();
// Add permssions for all USERGROUP shares of this item
if (!empty($ids)) {