From: eileen Date: Wed, 7 Oct 2020 06:44:18 +0000 (+1300) Subject: dev/core#2073 Fix memory leak in well tested code X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a36bd2a47106b1fa0926a5ac3bcc0f8a65b291ec;p=civicrm-core.git dev/core#2073 Fix memory leak in well tested code Example test api_v3_ContactTest::testSortLimitChainedRelationshipGetCRM15983 --- diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 24122a128a..7e6c9bfef2 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -983,8 +983,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); $queryString .= " AND id !=" . CRM_Utils_Type::escape($relationshipId, 'Integer'); } - $relationship = new CRM_Contact_BAO_Relationship(); - $relationship->query($queryString); + $relationship = CRM_Core_DAO::executeQuery($queryString); while ($relationship->fetch()) { // Check whether the custom field values are identical. $result = self::checkDuplicateCustomFields($params, $relationship->id);