mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
MFH: Fixed bug #48469 (ldap_get_entries() memory leaks on empty search results)
This commit is contained in:
parent
1fa3b21c15
commit
10b559c28c
@ -19,6 +19,7 @@
|
||||
| Jani Taskinen <sniper@iki.fi> |
|
||||
| Stig Venaas <venaas@uninett.no> |
|
||||
| Doug Goldstein <cardoe@cardoe.com> |
|
||||
| Patrick Allaert <patrickallaert@php.net> |
|
||||
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
@ -961,9 +962,6 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
ldap = ld->link;
|
||||
num_entries = ldap_count_entries(ldap, ldap_result);
|
||||
|
||||
array_init(return_value);
|
||||
add_assoc_long(return_value, "count", num_entries);
|
||||
|
||||
if (num_entries == 0) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
@ -974,6 +972,9 @@ PHP_FUNCTION(ldap_get_entries)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
add_assoc_long(return_value, "count", num_entries);
|
||||
|
||||
while (ldap_result_entry != NULL) {
|
||||
|
||||
MAKE_STD_ZVAL(tmp1);
|
||||
|
Loading…
Reference in New Issue
Block a user