From 80958d0f90dfa9a48e92e81e027121ec091c9d03 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 25 Jun 2019 15:49:28 +0200 Subject: [PATCH] Use ldap_destroy instead of ldap_unbind_ext --- ext/ldap/ldap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.40.0