MFH: Fixed bug #48469 (ldap_get_entries() memory leaks on empty search results)

This commit is contained in:
Patrick Allaert 2009-06-07 13:07:58 +00:00
parent 1fa3b21c15
commit 10b559c28c

View File

@ -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);