Skip to content

Commit

Permalink
Merge pull request #18641 from eileenmcnaughton/will-the-real-slim-le…
Browse files Browse the repository at this point in the history
…aky-please-stand-up

dev/core#2073 Fix a real live leak
  • Loading branch information
seamuslee001 authored Sep 30, 2020
2 parents af846d5 + 3e8437f commit 260e7da
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions CRM/ACL/BAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ protected static function getGroupACLs($contact_id, $aclRoles = FALSE) {
protected static function getGroupACLRoles($contact_id) {
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');

$rule = new CRM_ACL_BAO_ACL();

$query = " SELECT acl.*
FROM civicrm_acl acl
INNER JOIN civicrm_option_group og
Expand All @@ -228,7 +226,7 @@ protected static function getGroupACLRoles($contact_id) {

$results = [];

$rule->query($query);
$rule = CRM_Core_DAO::executeQuery($query);

while ($rule->fetch()) {
$results[$rule->id] = $rule->toArray();
Expand All @@ -249,7 +247,7 @@ protected static function getGroupACLRoles($contact_id) {
AND acl.entity_table = 'civicrm_acl_role'
";

$rule->query($query);
$rule = CRM_Core_DAO::executeQuery($query);
while ($rule->fetch()) {
$results[$rule->id] = $rule->toArray();
}
Expand Down

0 comments on commit 260e7da

Please sign in to comment.