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

Skip to content

Commit 7da4453

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 d7f1884. Revert "Added slapd to Travis requirements" This reverts commit 9b212ff. Revert "Fixed style errors 2" This reverts commit cbe0c16. Revert "Fixed style errors" This reverts commit a2dc110. Revert "Added functional tests for Ldap component" This reverts commit 33a6723.
1 parent cd86797 commit 7da4453

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