8000 [LDAP] Free the search result after a search to free memory · symfony/ldap@cf2f294 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf2f294

Browse files
committed
[LDAP] Free the search result after a search to free memory
Fixed error handling in ldap_search and ldap_free Added spaces around if Fixed trailing spaces Added functional tests for Ldap component Fixed style errors Fixed style errors 2 Added slapd to Travis requirements Added mkdir /tmp/travis to Travis build config Revert "Added mkdir /tmp/travis to Travis build config" This reverts commit d7f1884e6dc53602ad8dca6caeabb423445166cc. Revert "Added slapd to Travis requirements" This reverts commit 9b212ff5eb9fc2f4d6d54b787e4d307b0e164e21. Revert "Fixed style errors 2" This reverts commit cbe0c168d6c9a50dac1ba6593113573f53768be3. Revert "Fixed style errors" This reverts commit a2dc110f3df1b9e803447b94d2794eb1a3e8c300. Revert "Added functional tests for Ldap component" This reverts commit 33a67230dd25dabdb454381a3cdee95bdaac7f30.
1 parent 4acb890 commit cf2f294

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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