8000 bug #18490 [LDAP] Free the search result after a search to free memor… · symfony/symfony@b803680 · GitHub
[go: up one dir, main page]

Skip to content

Commit b803680

Browse files
committed
bug #18490 [LDAP] Free the search result after a search to free memory (hiddewie)
This PR was merged into the 2.8 branch. Discussion ---------- [LDAP] Free the search result after a search to free memory | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 7da4453 [LDAP] Free the search result after a search to free memory
2 parents ed9c94c + 7da4453 commit b803680

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/Ldap/LdapClient.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,17 @@ public function find($dn, $query, $filter = '*')
8484
}
8585

8686
$search = ldap_search($this->connection, $dn, $query, $filter);
87+
88+
if (false === $search) {
89+
throw new LdapException(ldap_error($this->connection));
90+
}
91+
8792
$infos = ldap_get_entries($this->connection, $search);
8893

94+
if (false === @ldap_free_result($search)) {
95+
throw new LdapException(ldap_error($this->connection));
96+
}
97+
8998
if (0 === $infos['count']) {
9099
return;
91100
}

0 commit comments

Comments
 (0)
0