From: Nikita Popov Date: Tue, 25 Jun 2019 13:49:28 +0000 (+0200) Subject: Use ldap_destroy instead of ldap_unbind_ext X-Git-Tag: php-7.4.0alpha3~179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80958d0f90dfa9a48e92e81e027121ec091c9d03;p=php Use ldap_destroy instead of ldap_unbind_ext --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3603ddda38..4460204071 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -104,7 +104,10 @@ static void _close_ldap_link(zend_resource *rsrc) /* {{{ */ { ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr; - ldap_unbind_ext(ld->link, NULL, NULL); + /* We use ldap_destroy rather than ldap_unbind here, because ldap_unbind + * will skip the destructor entirely if a critical client control is set. */ + ldap_destroy(ld->link); + #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) zval_ptr_dtor(&ld->rebindproc); #endif