From a36bd2a47106b1fa0926a5ac3bcc0f8a65b291ec Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 7 Oct 2020 19:44:18 +1300 Subject: [PATCH] dev/core#2073 Fix memory leak in well tested code Example test api_v3_ContactTest::testSortLimitChainedRelationshipGetCRM15983 --- CRM/Contact/BAO/Relationship.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); -- 2.25.1