Skip to content

Commit 80958d0

Browse files
committed
Use ldap_destroy instead of ldap_unbind_ext
1 parent 698dd32 commit 80958d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/ldap/ldap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ static void _close_ldap_link(zend_resource *rsrc) /* {{{ */
104104
{
105105
ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr;
106106

107-
ldap_unbind_ext(ld->link, NULL, NULL);
107+
/* We use ldap_destroy rather than ldap_unbind here, because ldap_unbind
108+
* will skip the destructor entirely if a critical client control is set. */
109+
ldap_destroy(ld->link);
110+
108111
#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
109112
zval_ptr_dtor(&ld->rebindproc);
110113
#endif

0 commit comments

Comments
 (0)