]> granicus.if.org Git - php/commitdiff
Use ldap_destroy instead of ldap_unbind_ext
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 25 Jun 2019 13:49:28 +0000 (15:49 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 26 Jun 2019 09:43:11 +0000 (11:43 +0200)
ext/ldap/ldap.c

index 3603ddda382ae7e3e840018bd58f48a2edffe8a2..44602040717dd5e446b64cffd9db221402321ba8 100644 (file)
@@ -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