]> git.sur5r.net Git - openldap/commitdiff
import fix to ITS#5103
authorPierangelo Masarati <ando@openldap.org>
Wed, 22 Aug 2007 22:44:41 +0000 (22:44 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 22 Aug 2007 22:44:41 +0000 (22:44 +0000)
CHANGES
libraries/libldap/controls.c
libraries/libldap/ppolicy.c

diff --git a/CHANGES b/CHANGES
index ea24cc1e72a2c80c0bd16ce406e24c74098a0a9b..8832d9f51e9eb77eb698a98f7936565ccbb99337 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,9 @@
 OpenLDAP 2.3 Change Log
 
 OpenLDAP 2.3.39 Engineering
+       Fixed libldap ppolicy control creation (ITS#5103)
        Documentation
-               Document slapd-sql workaround to ITS#4785
+               Added slapd-sql empty oc mapping workaround (ITS#4785)
 
 OpenLDAP 2.3.38 Release (2007/08/20)
        Fixed slapadd check for ';binary' when required (ITS#5071)
index 5aca2cdd439db4f213f47b90d4d076726437bdb8..cb01eb0ee617b7216ad36ac3560c60c61e950149 100644 (file)
@@ -442,7 +442,8 @@ ldap_create_control(
                return LDAP_NO_MEMORY;
        }
 
-       if ( ber_flatten2( ber, &ctrl->ldctl_value, 1 ) == -1 ) {
+       BER_BVZERO( &ctrl->ldctl_value );
+       if ( ber != NULL && ber_flatten2( ber, &ctrl->ldctl_value, 1 ) == -1 ) {
                LDAP_FREE( ctrl );
                return LDAP_NO_MEMORY;
        }
index 441a93c3c697233861490be92d6cbf1c1fa5c764..0322250e8180ce12db6a06dcf0e3235549f0e33b 100644 (file)
@@ -61,21 +61,13 @@ int
 ldap_create_passwordpolicy_control( LDAP *ld,
                                     LDAPControl **ctrlp )
 {
-       BerElement *ber;
-
        assert( ld != NULL );
        assert( LDAP_VALID( ld ) );
        assert( ctrlp != NULL );
 
-       if ((ber = ldap_alloc_ber_with_options(ld)) == NULL) {
-               ld->ld_errno = LDAP_NO_MEMORY;
-               return(LDAP_NO_MEMORY);
-       }
-
        ld->ld_errno = ldap_create_control( LDAP_CONTROL_PASSWORDPOLICYREQUEST,
-               ber, 0, ctrlp);
+               NULL, 0, ctrlp);
 
-       ber_free(ber, 1);
        return(ld->ld_errno);
 }